Start here
Lessons and reference
Look things up
Start here
SQL
Power Query
Data modeling
Power BI and DAX
Finance playbooks
Run queries
Build and check
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.
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.
1433 (SQL Server) or 3306 (MySQL / MariaDB).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.
| Server | learnsql.cpetoday.com |
| Port | 1433 (SQL Server) |
| Authentication | SQL Server login, not Windows |
| Username & password | Included with your CPE Today course |
| Data Connectivity mode | Import |
These steps use SQL Server, the recommended path. The first time takes a few minutes; after that it is one click.
learnsql.cpetoday.com,1433. Use a comma before the port, not a colon.contoso. The databases page lists them all.Import or DirectQuery? These samples are built for Import.
| Mode | What happens | Pick it when |
|---|---|---|
| Import | Power 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. |
| DirectQuery | Each 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. |
SELECT TOP (1000) * FROM FactSales,
instead of picking whole tables. Use it when you want one specific query.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.
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.
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.
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.
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.
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).
| What you see | What 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. |
Want a different database? The sample databases page groups them by topic, and each card says which engines it runs on.