MSBA-260 · Lesson 1 of 12 · 19 min
Data sources and connection modes
▶ Video coming soon A video version of this lesson is on the way.
Kwabena Asante-Lowe had been the data analyst in Lumenvale Community Colleges' institutional research office for two years, and for most of that time his reports had been built the hard way. Every Monday he exported enrolment counts from the student information system, pasted them into a workbook, copied in the bookstore and café sales that each campus emailed him, fixed the same spelling mistakes in the program names, and rebuilt the charts. By the time the dashboard reached the president's office in Kelowna, it was already a week old. When the college moved its reporting to Power BI, Rupert Ellingsworth, the IT governance lead, gave Kwabena one rule: no more copy and paste. "Every number should come from a source we can name, through steps we can read," he said. "That's what Power Query is for."
This course follows Kwabena as he rebuilds Lumenvale's reporting with Power Query, the data preparation engine inside Power BI Desktop, the Power BI service, Excel and Fabric dataflows. It covers the first functional group of Exam PL-300, Microsoft Power BI Data Analyst: Prepare the data, which the study guide (skills measured as of April 20, 2026) weights at 25 to 30 percent of the exam. That group has three parts: get or connect to data; profile and clean the data; and transform and load the data. The lessons that follow go through each one, and the last lesson brings them together in a case study that combines sales files from every campus outlet.
This first lesson answers the questions that come before any cleaning: where can data come from, how does Power BI connect to it, and what choices are made at the moment of connection that are hard to undo later?
Power Query in the Power BI workflow
A Power BI solution has three layers. Power Query gets and shapes data. The semantic model (formerly called a dataset) stores the shaped tables, the relationships between them and the DAX measures that calculate results. Reports visualize the model. Power Query sits at the front of that chain: whatever it produces is what the model receives. A mistake left in Power Query, such as a sales amount stored as text or a program name spelled three ways, flows into every measure and every visual downstream.
In Power BI Desktop, Power Query opens in its own window, the Power Query editor, when you choose Transform data on the Home tab. The editor has four areas worth knowing by name, because exam questions refer to them: the Queries pane on the left lists every query; the data preview in the centre shows the current result; the Query Settings pane on the right shows the query's name, properties and its list of Applied steps; and the formula bar above the preview shows the M code for the selected step. Every action you take with the ribbon or a right-click becomes a step written in M, the Power Query formula language. You rarely need to write M by hand, but reading it helps you understand what a query does.
The Get data experience
Every query begins with a connector. Get data on the Home tab of Power BI Desktop lists more than a hundred connectors, grouped into categories: File, Database, Microsoft Fabric, Power Platform, Azure, Online Services and Other. Common ones on the exam include Excel workbook, Text/CSV, Folder, SharePoint folder, SQL Server database, Dataverse, Web, OData feed and the connectors for Power BI semantic models and Fabric items such as lakehouses and warehouses. The OneLake catalog gives a searchable view of Fabric items and semantic models your organization has shared with you.
| Source type | Typical connector | What Kwabena used it for |
|---|---|---|
| Single file | Excel workbook, Text/CSV, JSON, XML | A one-off list of program codes from the registrar |
| Many files of the same shape | Folder, SharePoint folder | Weekly sales exports from bookstores and cafés |
| Relational database | SQL Server database, Azure SQL Database | Enrolment and course section tables |
| Business applications | Dataverse, Dynamics 365, SharePoint Online list | Advising appointments stored in Dataverse |
| Web and APIs | Web, OData feed | A provincial labour-market table published online |
| Existing models and Fabric items | Power BI semantic models, Lakehouse, Warehouse | The finance team's certified budget model |
Lumenvale's labour-market comparison came from a table published by the provincial government, and its campus locations used Canadian postal codes, which Kwabena later had to clean because some campuses typed them with a space and some without.
Choosing a source: the question of ownership
The exam objective says *identify and connect to data sources or a shared semantic model*. The first half is about picking the right connector. The second half is about not rebuilding something that already exists. Before connecting to raw tables, Kwabena asked the finance team whether a model of budget figures already existed. It did: a certified semantic model, endorsed by finance as the single source of budget truth. Connecting to it meant he did not have to reproduce finance's rules for fiscal periods and cost centres, and his reports would agree with theirs.
Rupert's governance checklist for any new source has four questions. Who owns the data? Is there an endorsed model or dataflow that already shapes it? How fresh must it be? And what credentials will the refresh use once the report is published? The answers drive the connection mode, the refresh design and, later, the gateway configuration covered in lesson 11.
Connection modes at a glance
When Power BI connects to a source, it does so in one of several modes, and the mode decides where the data lives and when queries reach the source. The next lesson compares the main storage modes in depth; here is the overview.
| Mode | Where the data lives | Power Query transformations | Typical use |
|---|---|---|---|
| Import | Copied into the semantic model and compressed in memory | Full set available | Most models; best query speed |
| DirectQuery | Stays in the source; queries sent at report time | Only steps that can be translated to the source | Very large or near-real-time relational data |
| Direct Lake | Delta tables in OneLake, loaded into memory on demand | Done upstream, in Fabric, not in the model | Large lake-centric Fabric solutions |
| Live connection | In another semantic model or Analysis Services | None: the report uses the other model as is | Thin reports on a shared certified model |
| Composite | A mix of the above in one model | Per table | Combining a shared model with local tables |
A live connection to a Power BI semantic model is the purest way to reuse someone else's work: the report has no Power Query of its own and simply uses the remote model's tables and measures. When Kwabena needed to add his own enrolment table next to finance's budget model, he switched to a composite model, using DirectQuery for Power BI semantic models to bring the shared model in alongside his imported tables. He could add relationships and measures locally while the budget figures stayed owned by finance.
Credentials and authentication
The first time Power BI connects to a source it asks for credentials, and the kinds offered depend on the connector. Files on a local or network drive need no sign-in. SQL Server offers Windows authentication (the current Windows account or alternate Windows credentials), Database authentication (a SQL user name and password) and Microsoft account for Azure-hosted databases. Cloud services such as SharePoint Online and Dataverse use an organizational account, signing in with Microsoft Entra ID. Web sources can be anonymous or use a key.
Credentials are stored per data source, not per query. Two queries that read the same SQL Server database share one saved credential. To see or change them, open Data source settings (on the Home tab of the Power Query editor, or under File, Options and settings in Desktop). There you can edit permissions, clear saved credentials and set the privacy level for each source, a topic lesson 11 covers in detail. The exam objective *change data source settings, including credentials and privacy levels* is tested most often as a troubleshooting question: a report that refreshed on Friday fails on Monday because the stored password expired, and the fix is in data source settings, not in the query.
Worked problem
Changing a source without rebuilding the query
Kwabena built his enrolment queries against a test copy of the student database on a server called LUM-SQL-TEST. In October the database team moved the data to the production server, LUM-SQL-PROD. How should he point his queries at the new server?
Show solution
- Open Data source settings and select the LUM-SQL-TEST source.
- Choose Change Source and enter the new server name, keeping the same database name.
- Check the credentials for the new source; the old saved credential does not carry over automatically.
- Refresh the preview in the Power Query editor and confirm row counts match what the database team expects.
Answer: Change Source in Data source settings updates every query that used the old server at once. Better still, as lesson 7 shows, he can store the server name in a parameter so the switch is a single value change.
What happens when you connect
After choosing a connector and signing in, Power BI shows the Navigator, a list of the tables, sheets or files available. Kwabena could tick tables and choose Load, which imports them straight into the model, or Transform data, which opens them in the Power Query editor first. Rupert's rule was to always choose Transform data. Even when a table looks clean, it pays to check column types and names before the model depends on them, and to remove columns the report will never use. Every unnecessary column costs memory and refresh time.
Inside the editor, the first steps of a new query are generated for you. For a SQL table they are usually Source (the connection) and Navigation (the chosen table). For a CSV file they include Source, Promoted Headers and Changed Type, where Power Query guesses each column's data type from the first rows. That automatic Changed Type step is convenient and occasionally wrong; lesson 4 explains how to check it.
let
Source = Sql.Database("LUM-SQL-PROD", "StudentRecords"),
Enrolment = Source{[Schema = "dbo", Item = "Enrolment"]}[Data],
#"Removed Other Columns" = Table.SelectColumns(Enrolment, {"StudentID", "ProgramCode", "TermCode", "Campus", "Credits"})
in
#"Removed Other Columns"Kwabena read the code from the top. The let block lists named steps, each built from the one before; the in clause names the step whose result the query returns. Step names that contain spaces are written with a hash and quotes, such as #"Removed Other Columns". This structure is the same in every query, however complicated.
Files, folders and SharePoint
Most of Lumenvale's messiest data arrived as files. A single file can be connected directly, but the bookstore and café exports arrived weekly, one file per outlet. Connecting to each file separately would mean a new query every week. The Folder connector instead lists every file in a folder, with columns for name, extension, dates and the file content itself, and the Combine feature turns all matching files into one table. When files live in a SharePoint document library or a Teams channel, the SharePoint folder connector does the same thing against the site, which also avoids needing a gateway because SharePoint Online is a cloud source. Lessons 7 and 12 build this pattern step by step.
A connection plan
By the end of the first week Kwabena had written a one-page connection plan for the reporting rebuild. It listed each source, its owner, its connector, the planned storage mode, how often it changed and what credentials the published refresh would use. Rupert signed it off before any report was published. A plan like this is a useful habit for exam scenarios too: when a question describes a business requirement, write down the source, the freshness needed and who owns it before choosing an answer.
| Source | Owner | Connector | Planned mode | Freshness |
|---|---|---|---|---|
| Enrolment tables | Registrar (Maribeth Ferreira-Quon) | SQL Server database | Import | Daily |
| Outlet sales exports | Campus services | SharePoint folder | Import | Weekly |
| Budget model | Finance | Power BI semantic models | DirectQuery (composite) | As published by finance |
| Advising appointments | Student services | Dataverse | Import | Daily |
| Labour-market table | Government publisher | Web | Import | Quarterly |
Reading exam scenarios about sources
Questions on this objective usually describe a team, a source and a constraint, and ask for the connector or setting that fits. Three habits help. First, look for words that signal reuse, such as *certified*, *shared* or *already published*: they point to connecting to a semantic model rather than rebuilding. Second, look for where the files live: a SharePoint library points to the SharePoint folder connector, a local drive or network share points to Folder and, after publishing, to a gateway. Third, separate connection problems from transformation problems: an expired password or a moved server is fixed in Data source settings, not with a new applied step.
Common mistakes
MistakeChoosing Load in the Navigator and fixing problems later in DAX.
InsteadChoose Transform data, check types and remove unused columns in Power Query, where cleaning belongs.
MistakeRebuilding a model that another team already publishes and certifies.
InsteadConnect to the shared semantic model with a live connection or a composite model.
MistakeEditing every query when a server moves.
InsteadUse Change Source in Data source settings, or a parameter for the server name.
MistakeAssuming credentials belong to a query.
InsteadCredentials are stored per data source and shared by every query that uses it.
Summary and key terms
- Power Query gets and shapes data; the semantic model stores it; reports visualize it.
- Every action in the Power Query editor becomes an applied step written in M.
- Get data offers connectors for files, folders, databases, Dataverse, web sources, Fabric items and semantic models.
- Connection modes include Import, DirectQuery, Direct Lake, live connection and composite models.
- Credentials and privacy levels are set per source in Data source settings.
- Power Query
- The data connection and transformation engine in Power BI, Excel and Fabric dataflows.
- M
- The formula language that records each Power Query step.
- Applied steps
- The ordered list of transformations that make up a query.
- Connector
- The component that knows how to connect to and read a particular kind of source.
- Live connection
- A report connection that uses another semantic model as is, without local Power Query.
- Data source settings
- The dialog where credentials, privacy levels and source locations are managed.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Where in Power BI Desktop do you change a saved password for a SQL Server source?
Show answer
In Data source settings, by editing the permissions of that source.
Why did Kwabena connect to finance's certified model instead of the budget tables?
Show answer
To reuse finance's rules and stay consistent with their figures instead of rebuilding them.
Which connector turns many files of the same shape in a document library into one table?
Show answer
The SharePoint folder connector with Combine.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.