Downloads
For Power BI Desktop

Connect Power BI Desktop to the sample databases

Pull a LearnSQL database into Power BI Desktop, shape the tables, relate them into a model, and refresh. Every connection is read-only, and the databases are synthetic, so you can experiment freely.

On this page

Who this is for

You are a finance professional who already knows the Power BI screens, or is about to learn them, and you want real-shaped data to practise on without waiting for an IT request. Ledgers, billing, budgets and receivables are all here. You do not need to know SQL to start: Power BI writes the query for you when you pick tables.

If you want to learn SQL first, try the browser SQL editor or DBeaver. If you prefer Excel, see Connect Excel & ODBC.

What you need

🔑 How access works

Direct database access is read-only and uses a login that comes with your CPE Today enrollment: any CPE Today database or Excel course includes it at no extra cost. Enroll once and the server login arrives with your lessons. It is the same login you use in Excel, ODBC and DBeaver. Prefer no login? The Web API is open to everyone.

Get access with a CPE Today course →

Serverlearnsql.cpetoday.com
Port1433 (SQL Server)
AuthenticationSQL Server login, not Windows
Username & passwordIncluded with your CPE Today course
Data Connectivity modeImport

Connect with Get Data

These steps use SQL Server, the recommended path. The first time takes a few minutes; after that it is one click.

  1. In Power BI Desktop, go to Home > Get data > SQL Server database.
  2. In Server, enter learnsql.cpetoday.com,1433. Use a comma before the port, not a colon.
  3. In Database, enter a name such as contoso. The databases page lists them all.
  4. Under Data Connectivity mode, choose Import. Then click OK.
    Get Data > SQL Server database (illustrative) SQL Server database Server learnsql.cpetoday.com,1433 Database contoso Data Connectivity mode DirectQuery Import selected OK Cancel
    Illustration, not a screenshot. Server (with the comma and port), Database, and Import selected. Your Power BI version may word the labels a little differently.

    Import or DirectQuery? These samples are built for Import.

    ModeWhat happensPick it when
    ImportPower BI copies the tables into your file once per refresh. Visuals are fast, it works offline, and every DAX function is available.Almost always, including these samples.
    DirectQueryEach visual sends a fresh query to the server. Results are always current, but slower, and some DAX and Power Query steps are limited.A project really needs live data.
  5. Optional: open Advanced options to paste a SQL statement, for example SELECT TOP (1000) * FROM FactSales, instead of picking whole tables. Use it when you want one specific query.
  6. A sign-in window opens. Choose the Database tab, not Windows. Enter the User name and Password from your CPE Today course, then click Connect.
    SQL Server: sign in Windows Database not Windows User name your-username Password •••••••••• Connect Cancel
    Illustration. Choose the Database tab, not Windows, then use the login from your CPE Today course. Placeholders only: never type your real password into a shared file.
  7. If Power BI shows a certificate or encryption prompt, click OK to continue. This is a public teaching server with a self-signed certificate, so the prompt is expected.
  8. In the Navigator, tick the tables you want, check the preview on the right, and then choose Transform Data (recommended) or Load.
    Navigator contoso DimCustomer DimDate DimProduct DimStores FactSales FactBudget FactInventory Preview: FactSales (sample rows) SalesKeyDateKeyProductKeySalesAmount 120090101Product 1259.80 220090101Product 4024.20 320090102Product 711.50 Load Transform Data
    Illustration. Tick the tables you need, check the preview, then choose Transform Data to filter and shape them first, or Load to bring them in as they are.

Tip: filter before you load

Transform Data opens Power Query. Filter rows and remove columns you do not need before the data reaches the model. It is much faster on large tables such as FactSales.

Shape, relate and refresh

Shape in Power Query

Check the column types. If a key column loads as a decimal number, change it to Whole number so the relationships can match. Then click Close & Apply.

Relate the tables in Model view

Open Model view from the left rail. Drag a key column from a dimension onto the matching key in the fact table, or use Manage relationships. Each relationship should be one-to-many, from the dimension (1) to the fact table (*), with a single filter direction. Then mark the calendar: select DimDate, choose Table tools > Mark as date table.

FactSales DateKey · CustomerKey · ProductKey StoreKey · SalesAmount · SalesQuantity DimDateYear, month, fiscal period DimCustomerSegment, city, country DimProductCategory, brand, margin DimStoresStore, region, opened date 1*1*1*1*
The star in Model view. Each dimension (1) connects to the fact table (*) on a key. Filters flow from the dimensions into FactSales, so a slicer on a product filters every sales total.

Refresh

Start from a finished model

The downloads page has complete Power BI projects built on the Contoso database. Extract the whole zip, open the .pbip file in Power BI Desktop, click Refresh, and sign in when prompted. Then read the measures in Model view. The Power BI Desktop how-to explains each part.

MySQL, MariaDB and ODBC

MySQL or MariaDB

Choose Get data > MySQL database. In Server type learnsql.cpetoday.com (3306 is the default port; to give it, add it after a colon: learnsql.cpetoday.com:3306), with the same course login (the MySQL and MariaDB databases, such as northwind, world and acme, are listed on Connect Excel & ODBC). Power BI uses the MySQL connector: if it asks for it, install the MySQL connector that matches Power BI Desktop, then try again.

ODBC

If you already set up the LearnSQL ODBC data source for Excel, choose Get data > ODBC and pick it. The steps are in Excel → ODBC (DSN).

Troubleshooting

What you seeWhat to do
“Login failed for user” Check the user name and password, and that you chose Database, not Windows. Copy-paste the exact values from your course. The server blocks IP addresses after repeated failed logins, so wait a while before you try again if you have mistyped several times.
“We couldn't authenticate” Power BI has saved credentials that the server rejected, or the wrong tab was used. Go to File > Options and settings > Data source settings, select the LearnSQL source, choose Edit Permissions, and sign in again on the Database tab.
Certificate chain not trusted, or an encryption warning Click OK: the server uses a self-signed certificate. If your organization blocks the prompt, the ODBC route accepts it with TrustServerCertificate=yes, as shown on Connect Excel & ODBC.
Cannot connect or the connection times out Your network may block outbound port 1433. Try a different network. If you cannot, use the open Web API route, which uses HTTPS on port 443.
Wrong server format SQL Server uses a comma before the port: learnsql.cpetoday.com,1433. A colon fails.
DirectQuery is slow or refuses a step DirectQuery sends a query for every visual and click, and only some DAX functions and Power Query steps are supported. Remove the source and add it again in Import mode. Import is what these samples are built for.

Next steps

Want a different database? The sample databases page groups them by topic, and each card says which engines it runs on.