What is a .bim file?
A .bim file is a tabular model written out as text. It is JSON. The name comes from the Analysis Services tooling of the SQL Server Data Tools era, where it stood for Business Intelligence Model, and it is still the file Tabular Editor and Visual Studio read and write.
What is inside
- Every table and its columns, with data types, formats and whether they are hidden.
- Every relationship, with its direction, cardinality and whether it is active.
- Every measure, with its DAX expression and display folder.
- Calculated columns, calculated tables and calculation groups.
- Each table's partitions. For an imported table the partition's source is the Power Query M expression, so the whole transformation script is in the file.
- Hierarchies, roles and row-level security filters, perspectives, annotations.
What is not inside
Data rows. A .bim describes the shape of a model, not what it holds. Row counts and sizes are not there either; those live in the .vpax export.
Where it comes from
Power BI Desktop keeps this same definition inside the .pbix. Tabular Editor exposes it with File → Save As. Power BI Projects save the same content as a folder of TMDL text files. Analysis Services projects have always used it directly.
Why people want it
It is text, so it can be diffed, searched and kept in version control. A model documented from its .bim is complete by definition: nothing is left out because someone forgot to click on it.
What to be careful with
The M expressions contain your data source addresses, server names and sometimes database names. The DAX contains your business logic. Lantern reads the file inside your browser and sends nothing, for exactly this reason.