Sub topic 1
From .pbix file to published report
Prerequisites
This chapter assumes you have the following:
- Basic familiarity with Power BI Desktop and enough experience to build a simple report.
- A Microsoft work or school account that can sign in to the Power BI service.
- An understanding that a report and the data behind it are separate things.
You do not need a workspace yet. The next chapter covers workspaces.
What a .pbix file contains
A .pbix file is the single file Power BI Desktop saves on your computer. It bundles several parts:
- The report pages, with their visuals, filters, and formatting.
- The data model: tables, relationships, measures, and calculated columns.
- The Power Query steps that load and shape the data.
- In import mode, a compressed copy of the data that was loaded.
Because the file holds both the report and the model, you can open it, change either part, and save it again. The Power BI service stores these two parts as separate items. That split is the main idea of this chapter.
Report and semantic model
A report is the set of pages and visuals people look at. A semantic model is the data model that feeds those visuals. Older documentation and some menus call it a dataset. The service renamed it, but the REST API still uses "dataset" in many places.
| Part | What it holds | Who uses it |
|---|---|---|
| Report | Pages, visuals, filters | People reading the report |
| Semantic model | Tables, relationships, measures, data source settings | The report, and refresh settings |
The two parts stay linked. A visual in the report reads from the semantic model, and the model holds the connection details used to refresh the data.
The journey of a file
Publishing sends a copy of your local file to a workspace. The file on your computer is not moved or changed. Edits you make later in Desktop do not appear in the service until you publish again.
Where the data lives
What happens to your data depends on the storage mode of each table.
- Import mode. The data is copied into the model. After publishing, the service holds its own copy. That copy stays as it was until it is refreshed.
- DirectQuery or live connection. The model stores no copy of the data. Visuals send queries to the source when someone opens the report.
- Mixed (composite) models. Some tables are imported and others use DirectQuery.
A look at the file itself
A .pbix file is a ZIP archive. You can list its contents to see the parts for yourself. This Python script uses only the standard library. Replace the file name with one of your own.
import zipfile
with zipfile.ZipFile("Sales.pbix") as pbix:
for item in pbix.infolist():
print(f"{item.file_size:>12,} {item.filename}")You will usually see entries for the report layout, the data model, and metadata. Do not edit these files by hand. Changing them can make the file unreadable in Desktop.
Common mistakes
- Treating the file as the report. The .pbix is the source. The published report is a copy. Keep the .pbix safe, because it is how you make changes later.
- Expecting live data after publishing an import model. Without a scheduled refresh, the service data does not change.
- Forgetting that local sources need extra setup. A semantic model that reads from a file on your PC or a database on your network cannot refresh in the cloud by itself. Later chapters cover credentials and gateways.
- Assuming a published report is shared with everyone. Publishing places the report in a workspace. Access depends on workspace roles and sharing settings.
What comes next
You now have the model for the rest of the tutorial. One local file becomes two linked items in a workspace, a report and a semantic model. The next chapters cover where those items go (workspaces), who is allowed to publish (roles and licenses), and how to publish from Desktop.
Exercise
You build a report in Power BI Desktop using imported data, then publish it. The next day the source database changes. You open the published report and see the old numbers. Explain why, and name two things that would update the numbers.
Show answer
The semantic model in the service holds a copy of the data loaded when you published. The service does not read the source again on its own. The numbers update if you refresh the semantic model, either manually or on a schedule, or if you reload the data in Desktop and republish the .pbix file. A source that is not reachable from the cloud also needs a gateway or stored credentials for the refresh to work.
Exercise
After publishing Sales.pbix, you find two items in the workspace named Sales. What are they, and which one holds the measures?
Show answer
One is the report and the other is the semantic model. The semantic model holds the tables, relationships, and measures. The report holds the pages and visuals that read from it.