Sub topic 1
Starting from Get Data: how Power BI connectors work
Power BI Desktop uses connectors to retrieve data from systems such as Excel, CSV files, and SharePoint. Each connector understands that source's structure and presents available objects in the Navigator window.
Prerequisites
Assume you can open Power BI Desktop and understand tables, rows, columns, and basic data types. You should also know how Excel tables and CSV files are organized.
Get Data and Power Query
Choose Home > Get data, select a connector, and provide the file path, site URL, or other connection details. The Navigator then shows objects that Power BI can read. Select an object and choose Transform Data to open Power Query Editor, or Load to accept the previewed result.
Power Query Editor records each transformation as an applied step. A step is a named instruction, such as promoting headers or changing a column type. Steps run from top to bottom, so later steps can depend on earlier ones.
let
Source = Excel.Workbook(File.Contents("C:\Data\Sales.xlsx"), true, true),
SalesTable = Source{[Item = "Sales", Kind = "Table"]}[Data],
Typed = Table.TransformColumnTypes(
SalesTable,
{{"OrderDate", type date}, {"Amount", type number}}
)
in
TypedWhy these sources use Import mode
Excel workbooks, CSV files, and files stored in SharePoint are normally copied into Power BI's Import mode. Power BI stores an in-memory model of the transformed data, which supports fast report interaction. The original source is not queried for every visual.
A refresh reruns the Power Query steps and updates the imported model. SharePoint Online can usually refresh through the Power BI service. Local files generally need an on-premises data gateway after publishing.
Excel workbooks
The Excel connector may expose worksheets, Excel tables, and named ranges. Prefer an Excel table for production queries because its name and columns remain stable when rows are added. A worksheet can include titles, blank rows, or formatting that must be cleaned. A named range is useful when a deliberate rectangular range is maintained.
CSV files
The Text/CSV connector asks for the delimiter, file encoding, and whether the first row contains headers. A wrong delimiter can place every record in one column. A wrong encoding can corrupt characters such as accents. Promote the first row only when it contains field names, then set explicit column types.
Exercise
Which Excel object is usually the most stable source for a growing dataset?
Show answer
A named Excel table, because its structure and name are designed for tabular data.