Saving .pbix Files & Understanding Workspaces
A .pbix file is not a document — it is a container holding your queries, your model, your data and your report. Understanding what is inside it explains file sizes, sharing problems, and the difference between a .pbix and a .pbit. This lesson also connects your local file to the workspace concept you will meet properly in Module 12.
Learning Objective
People treat .pbix files like Word documents and are then surprised by 300 MB files, broken sharing, and colleagues who cannot refresh. Knowing what is inside removes all of that surprise.
- Describe what a .pbix file actually contains
- Explain the difference between .pbix and .pbit and when to use each
- Predict why a .pbix file is large and what would shrink it
- Organise project files so they remain workable months later
- Explain how a local file relates to a workspace in the Power BI service
Why This Matters
Three practical situations this explains.
- "Why is my file 400 MB?" Because with Import storage mode, the data is inside the file. Every row you loaded and never used is still in there.
- "I sent the file and they cannot refresh it." Because the .pbix stores the connection path, not the source. If it points at
C:\Users\you\Desktop\sales.csv, nobody else can refresh it. - "I want to share the design but not the data." That is precisely what a .pbit template is for.
Ctrl+S should be a reflex, not a decision.Concept
What is inside a .pbix
A .pbix is a compressed archive. Four things live in it:
| Component | What it is | Size impact |
|---|---|---|
| Queries | Your Power Query M code — the recipe for getting and shaping data | Negligible. It is text |
| Model | Table definitions, relationships, DAX measures, calculated columns, hierarchies, RLS roles | Small, except calculated columns which materialise per row |
| Data | The imported rows, compressed by the VertiPaq engine | This is almost all of the file size |
| Report | Pages, visuals, their fields, formatting, bookmarks, theme | Small |
.pbix versus .pbit
| .pbix | .pbit | |
|---|---|---|
| Contains data | Yes (Import mode) | No |
| Contains queries, model, report | Yes | Yes |
| Typical size | Megabytes to hundreds of megabytes | Kilobytes |
| On opening | Opens as-is | Prompts for any parameters, then refreshes from source |
| Use it for | Your working file | Sharing a design, or a reusable starting point |
Save a template with File › Export › Power BI template. If your queries use parameters — a file path, a server name, a date range — the .pbit prompts for them on open, which makes it a genuinely useful distribution mechanism. Module 3 Lesson 8 covers parameters.
Why files get large, and what actually helps
| Cause | Why | Fix |
|---|---|---|
| High-cardinality columns | VertiPaq compresses by distinct value. A column with millions of unique values compresses poorly | Remove it, or reduce precision (drop the time component from a datetime) |
| Columns you never use | Every loaded column is stored, used or not | Remove them in Power Query. This is usually the biggest single win |
| Auto date/time | Creates a hidden date table per date column | Turn it off and build one proper date table |
| Calculated columns | Materialised per row and compress worse than imported columns | Move the logic to Power Query, or make it a measure instead |
| Loading more history than you need | Ten years loaded when two are reported on | Filter in Power Query, ideally with query folding so the source does the work |
Local files and workspaces
Your .pbix lives on your machine. A workspace is a container in the Power BI service. Publishing uploads the model and the report into a workspace.
Visual Explanation
Where the bytes actually go in a typical Import-mode file.
A sensible project folder
| Path | Contains |
|---|---|
/project-name/ | The project root |
/data/ | Source files. Never edit these by hand |
/pbix/ | Working .pbix files, versioned |
/templates/ | .pbit exports |
/docs/ | KPI definitions, model diagram, cleaning log |
README.md | What this is, who it is for, how to refresh it |
sales-report-v1.pbix, sales-report-v2.pbix. Unglamorous, and it has rescued a great many people. Power BI Desktop has no version history and no undo across sessions. Git does not help much either — .pbix is a binary archive, so Git stores whole copies and cannot diff them meaningfully.Power BI Demonstration
Example Dataset
This lesson is conceptual and needs no download — it uses the sample data shown inline above. The next lesson that requires a file will link it here.
You can still browse every dataset in the course from the dataset library.
Step-by-Step Exercise
/data/, /pbix/, /templates/, /docs/. Move your files into it.ShipDate, UnitPrice and COGS if your report does not use them. Close & Apply and record the new size./docs/, write a short file covering: what this report answers, where the data comes from, how to refresh it, and any assumptions. Ten minutes now, hours saved later.Expected Result
You should see a measurable size reduction from removing columns, and a dramatic difference between the .pbix and the .pbit.
| Step | What you should observe |
|---|---|
| Baseline .pbix | Typically smaller than the source CSV, thanks to compression |
| After removing unused columns | A noticeable reduction — often 20–40% on a wide table |
| After disabling auto date/time | A further reduction, larger if you had several date columns |
| .pbit template | A tiny fraction of the .pbix — usually kilobytes |
Common Mistakes
Fix: Know your storage mode. If you need to share a design without data, export a .pbit template. Treat every Import-mode .pbix as containing everything it loaded.
Fix: Remove unused columns in Power Query. Hiding is for usability; removing is for size.
C:\Users\you\.... The recipient can view the stored data but cannot refresh.Fix: Use a shared path (SharePoint, OneDrive, a network drive) or a parameter for the file location. Check Data source settings before sending anything.
Fix:
Ctrl+S constantly, and version by filename at meaningful milestones.Fix: Decide explicitly where authoritative editing happens — normally Desktop — and tell the team. Module 12 covers the collaboration options properly.
Professional Tip
Three things this gives you: the file works on anyone's machine, moving your data folder does not break anything, and a .pbit exported from it prompts the recipient for their own path on open — which turns a template into something genuinely reusable rather than a curiosity.
Module 3 Lesson 8 covers parameters in full. Adopting the habit now costs nothing.
Two more:
- Write the README before you think you need it. Four lines — what it answers, where the data comes from, how to refresh, known assumptions. You will be the person who needs it, six months from now, having forgotten everything.
- Keep a clean template of your own. A .pbit with your theme, your standard date table and your usual measures, and every new project starts twenty minutes ahead.
Knowledge Check
Knowledge Check
5 questions. Answer each one to see why the right answer is right.
Your .pbix is 180 MB. Which action would reduce it most?
What is the key difference between a .pbix and a .pbit?
You email a .pbix to a colleague. They can see all the numbers but cannot refresh. Why?
When you publish a .pbix to a workspace, what appears in that workspace?
Why is Ctrl+S more important in Power BI Desktop than in most applications?
Practical Challenge
Make a project portable
Take a working .pbix built from local files and make it something you could hand to a colleague, or open yourself on a different machine, with everything working. Then write a short handover note.
- Replace hard-coded file paths with a parameter
- Remove every column your report does not use, and record the size before and after
- Export a .pbit template with a useful description
- Set up the project folder structure from section 04
- Write a README covering purpose, sources, refresh instructions and assumptions
- State one thing that would still break for a colleague, and how you would fix it
For the parameter: Home › Manage Parameters › New Parameter, type Text, and give it your folder path as the current value. Then in the query's Source step, edit the M to concatenate the parameter with the file name — the Advanced Editor makes this easiest.
For the last requirement, think about what a parameter does not solve. What else in a query is machine-specific or person-specific?
Solution
Try the challenge properly before opening this. Reading a solution you have not attempted feels like learning, but it is not.
A model answer
1 · Parameterising the path
Create a text parameter named DataFolder with a current value such as C:\bwb\data\. Then in the Advanced Editor, change the Source line from a literal path to a concatenation:
let
Source = Csv.Document(
File.Contents(DataFolder & "bwb-retail-sales.csv"),
[Delimiter = ",", Encoding = 65001, QuoteStyle = QuoteStyle.Csv]
),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars = true])
in
#"Promoted Headers"Now anyone opening the .pbit is prompted for their own folder, and moving your data directory requires one parameter change rather than editing every query.
2 · Removing unused columns
Add a Table.SelectColumns step, or use Home › Choose Columns. On the sales table, if your report only covers revenue by month, channel and category, you can drop ShipDate, UnitPrice, Discount and COGS — keeping Profit if you report margin.
Record both figures. A typical result on this dataset is a reduction of roughly a quarter to a third, from four dropped columns on a thirteen-column table.
3 · The template
File › Export › Power BI template. In the description field, write something a recipient can act on:
4 · Folder structure and README
retail-reporting/
├─ data/ source CSVs — never edited by hand
├─ pbix/ retail-report-v3.pbix (working file)
├─ templates/ retail-report.pbit
├─ docs/ kpi-definitions.md, model-diagram.png, cleaning-log.md
└─ README.md5 · The thing that would still break
Power BI stores data source credentials per user, per machine — they are not in the file. When your colleague opens the template and points it at their folder, Power BI will still ask them to authenticate to that source, and to set a privacy level for it. For a local CSV that is a minor prompt they can click through. For a SQL Server source it means they need their own database access, which no amount of file preparation can provide.
How I would handle it: state it explicitly in the README — "you will be prompted for credentials on first refresh; for the CSV sources choose Anonymous / Organizational as appropriate" — and, for database sources, name who to ask for access. A handover note that anticipates the first thing that will go wrong is worth more than one that describes the happy path.
Lesson Summary
- A .pbix contains four things: queries, model, data and report. In Import mode the data is nearly all of the file size.
- A .pbit template contains everything except the data — tiny, and it refreshes from source on open.
- To shrink a file, remove columns in Power Query. Hiding does nothing for size.
- Turn off auto date/time — it creates a hidden date table per date column.
- A .pbix stores the connection path, not the source. Parameterise paths so files are portable.
- Credentials are stored per user, per machine — they never travel with the file.
- Publishing creates two artifacts in a workspace: a report and a semantic model.
- There is no autosave for local files. Save constantly and version by filename.
Syllabus topics delivered
Progress
Marking a lesson complete stores your progress in this browser and updates your BitWithBite learner dashboard. Nothing is uploaded anywhere.