What a saved run holds

Every run of trailsbi saves a snapshot: everything TrailsBI knows about the project, as one JSON document. Imported data is never read. Everything else in the project's report and model files is in it, as it's written. trailsbi diff compares two of them.

Runs are kept in your user profile, in a folder for each project:

%LOCALAPPDATA%\TrailsBI\runs\<project>\                  on Windows
~/Library/Application Support/TrailsBI/runs/<project>/   on macOS
~/.local/share/trailsbi/runs/<project>/                  on Linux

project.json       where the project is, and the last number given to a run
000014.json.gz     run 14's snapshot, compressed with gzip
000014.json        its time, names, Git commit and branch, selection, counts and hashes

<project> is a code made from where the project is: project.json says which one it is. Other tools can read the runs, and shouldn't change them: diff doesn't use a run whose hash doesn't match. Saved runs says how they're named, listed, deleted and turned off.

The same project gives the same snapshot, byte for byte, on any machine: there is no date in it, and nothing about where the folder is. The name of a workspace folder is in it.

The schema is snapshot-1.0.schema.json.

What is in it

  • Every table, column, measure, hierarchy, role, relationship and so on, with its properties and its code in full: DAX, Power Query and SQL.
  • Data sources with their servers, databases, URLs and full file paths.
  • The definitions of pages, visuals, visual groups, filters, bookmarks, mobile layouts, report settings and the model view's layout.
  • Every other file in a report's or model's folder, such as Copilot files, themes, saved DAX queries, TMDL scripts and notes.
  • What uses what, which references are broken, the Health and AI Readiness findings and the structural readiness score.

Run trailsbi scan before you share a run. Rows typed into queries, values picked in filters, role members, passwords and keys are in it, if they're in the project.

What is left out

Left out What is there instead
Imported data (.pbi/cache.abf) and the personal settings next to it nothing
Images and other files that aren't text, and custom visuals' own code {"fingerprint": "1f2e3d4c5b6a7988"}, a code that changes when the file does
Where the project is on your machine nothing
The hidden TrailsBI table and page that --embed adds, and TrailsBI's own pages, reports and snapshots nothing
.git folders, and what links lead to nothing

The document

Key What it holds
format Always trailsbi-snapshot
schemaVersion 1.0. A later 1.x only adds, and the schema accepts that; readers ignore what they don't know. Changing or removing anything makes it 2.0
generator TrailsBI's name and version
project Its name, and the workspaces when it's a workspace folder
selection What was asked for (--model, --report, --workspace, --filter), and the IDs of what that left out
items The semantic models and reports, with their props and other files
objects Everything inside them, and the data sources
edges What uses what
broken References to something that doesn't exist
unread Files that couldn't be read. Their text is in the item's files. An empty path is a whole model or report, whose item has unread too
rules, findings The Health and AI Readiness rules, and what they found
readiness The structural readiness score, or null when no semantic model was checked
notes What else the run had to say

Lists are sorted, with one element per line.

IDs

Every item and object has an ID made from what the project's files store:

semanticModel:c8e152d5-…/measure:938be727-…
report:0d62a7fc-…/page:9cc1f1d2…/visual:281c83a0…
semanticModel:c8e152d5-…/table:574e7ea3-…/calculationItem:~YTD
source:~sql.database|srv.contoso.com|sales

A part without ~ is an identifier Power BI keeps. Renaming the object doesn't change it, and neither does moving a measure to another table. A part with ~ is made from a name, path or address, so it can change. idFrom says which:

idFrom The ID's last part is made from
lineageTag A table's, column's, measure's, hierarchy's, level's, expression's, function's or calendar's tag
logicalId A semantic model's or report's ID in .platform
pbirName A page's, visual's or visual group's name in its file
relationshipName A relationship's name
connection A published semantic model's ID, in the report's connection (published:…)
name The object's name, inside the ID of what holds it. For a published model, its name, with its workspace or server when several have that name (`published:~Test
path Where it is: a page's or visual's folder, or a model's or report's path from the folder that was read
position A legacy report's page or visual without a name
ends A relationship without a name: its two tables and columns, between `
address A data source: its connector and the parts of its address as they're written, between |. A part that can't be worked out is ?, so sources that only differ in that share an ID
fixed A report's filters

%, /, |, control characters and a leading ~ in a name are percent-encoded. GUIDs are in lower case.

When an ID changes. An identifier counts only while it's unique in what was read:

  • Two objects with one lineageTag, as when a measure's text is copied with its tag, are both known by name, and a note says so. The same goes for two items with one logicalId.
  • When a page or visual is copied with its name, the one in the folder of that name keeps it, and the copies are known by their folders.
  • Reading another folder too can add a workspace's name to an ID, when two things would otherwise have the same one.
  • A path, and so an ID made from one, depends on which folder was read: ~Sales.SemanticModel from the project's folder is ~Sales%2FSales.SemanticModel from the one around it.
  • The fields of a model that was left out (--report) are known by name, because the model wasn't read.

trailsbi diff pairs objects in other ways as well, so these don't make things look removed and added. Other tools that keep IDs should look at idFrom and notes. In the rare case that two IDs would still be the same, the second gets |2.

Objects

kind is Microsoft's name for the object: the TMDL keyword, or the name in Microsoft's report schemas. props holds the properties the file states, under Microsoft's names. These are TrailsBI's own:

Property On What it is
id, item, parent, idFrom, tag everything The ID, the IDs of the item and of what holds it, what the ID is made from, and the lineageTag or logicalId
expressions anything with code Each with the property it's in (expression, formatStringDefinition, kpi.targetExpression, source.expression, filterExpression…), its language (DAX, M, SQL) and text
tableKind table data, calculated, calculationGroup or fieldParameter
generated table An automatic date table
parameter expression A Power Query parameter
reportMeasure measure Defined in a report
external column, measure A field of a model that wasn't read; only its name is known
definition, mobile page, visual, visualGroup The object's file. JSON that a legacy report keeps in text is JSON here
connector, address source Where the data comes from

An object whose files give it several lineageTags has them all in props.lineageTags, and the first is in its ID. Objects of kinds TrailsBI doesn't know are in the item's props.otherObjects, as they're written.

The kinds source (a data source) and reportFilters (a report's filters on all pages) are TrailsBI's own too, and so are props.order on a page and props.table on a report measure. Levels and calculation items have Microsoft's ordinal, from their order in the file where TMDL leaves it out. Four properties name another object by its ID: sortByColumn, a level's column, and a relationship's fromColumn and toColumn. When there is no such object, they have the name the file gives (Region, Sales[Region]) and the reference is in broken. An ID starts with the ID of its item. Translations have one shape in both formats: model, with tables, columns, measures, hierarchies and levels by name, each with its caption, description and displayFolder.

Edges

An edge goes from what is used to what uses it.

kind From → to
data Data source, query or parameter → query or table
contains Table → column, column → level, calculation item → its group
home Table → the measures it holds
sort Column → the column it sorts
dax What an expression names → the object that holds the expression, with the property when it isn't expression
reference What a property names → the object that holds it, with the property: variations, alternateOf, relatedColumnDetails, calendarColumnGroups, parameterValuesColumn or columnPermissions
visual Field → visual, with the field wells in roles
page Visual → page, and a filter's, drillthrough's or page refresh's field → page or report filters

ambiguous marks a column that DAX names without its table when several tables have one by that name.

Broken references

from has a reference, in its in (field, filter, dax, relationship, hierarchy, sort, query or property), to something that is missing. A field must be exactly what the report names: a measure that was moved to another table is missing, as it is for Power BI. In DAX, a name that the expression may make itself is never counted. Models that are published elsewhere or connected live can't be checked.

OpenLineage

transformation on an edge is OpenLineage's own type and subtype. A semantic model's tables map to datasets (namespace powerbi:// and the model's key, name from the table's ID), columns and measures to their fields, data, contains, dax and visual edges to columnLineage, and a report to a job. OpenLineage events carry a time, which a snapshot doesn't have on purpose, so an export adds it.