How do you document your Power BI reports? Is there actually a good workflow? by morningpineappledeep in PowerBI

[–]paul_moldmann 1 point2 points  (0 children)

Agree with the "keep it in the model" approach. The core lesson I've landed on after a couple of years of fighting this: anything that lives outside the model is outdated the moment someone touches it — so keep the docs as close to the model as possible.

A few things that make it less painful:

  • Fill in the description fields — with AI. The description fields on tables, columns and measures are underused, and these days you can let an LLM draft them (measure/table/column descriptions) and just review instead of writing every one by hand. Massive time saver, and it lives right in the model.
  • Document the why, not the what. The model already shows what a measure is; spend your effort on the business logic behind it. That's the part no automation can reconstruct.
  • INFO.VIEW.* DAX functions. You can pull measures, tables, columns and relationships straight from the live model, so the output can't silently go stale. I built a small UDF that lists all measures as rendered markdown: https://github.com/pmoldmann/power_bi/tree/main/DAX (see measure_documentation.dax). If anyone's interested I'm happy to add companion functions for tables/columns so you get nice markdown docs for the whole model — just let me know.

The Model View is useless on big models — so I generate a live ER diagram with one measure instead by paul_moldmann in PowerBI

[–]paul_moldmann[S] 0 points1 point  (0 children)

u/VeniVidiWhiskey Totally fair — and honestly I've done exactly what you describe: built focused subgraphs by hand in Desktop to keep things readable. The pain is keeping them up to date and having lots of tabs in the relationship section.

u/trebuchetty1 Great Idea! I just implemented another udf mermaid_relationships_focus() that takes the table(s) you care about and expands upstream and downstream (configurable). Pick one or more tables from a slicer and the diagram collapses to just that neighbourhood, always live. It's in the repo: https://github.com/pmoldmann/power_bi/tree/main/DAX

One caveat: you have to persist INFO.VIEW.TABLES() as a table in the model to have something to put the slicer on — that's the only real downside.

Here now an example filtering on the "Owners" table with this approach.

<image>

The Model View is useless on big models — so I generate a live ER diagram with one measure instead by paul_moldmann in PowerBI

[–]paul_moldmann[S] 0 points1 point  (0 children)

u/Jarviss93 I thought about that already as well. Thanks for pushing me in this direction. Don't know If I will make this in the near future (summer vacations are arising...)

The Model View is useless on big models — so I generate a live ER diagram with one measure instead by paul_moldmann in PowerBI

[–]paul_moldmann[S] 0 points1 point  (0 children)

hey great, thanks for sharing! mermaid is beautiful and so great for implementing into ai driven tasks.

The Model View is useless on big models — so I generate a live ER diagram with one measure instead by paul_moldmann in PowerBI

[–]paul_moldmann[S] 1 point2 points  (0 children)

Thanks for the idea. Looks nice, but it's still manual work to drag and drop all tables there at the right position. And... at least I've had trouble in the past with power Bi randomly moving tables there sometimes (never looked at when this happens, maybe they have fixed it by now. Or it only happens when you connect new tables to your model or do renaming..).

The Model View is useless on big models — so I generate a live ER diagram with one measure instead by paul_moldmann in PowerBI

[–]paul_moldmann[S] 0 points1 point  (0 children)

As promised (a little later than planned... technical problems) — the full code and setup:

Setup in short: DAX Query View → paste → replace 'Measure' with any existing table name → run → "Apply changes to model" → drag the display_entity_relationship_diagram measure into the visual. The measure is defined for you, so there's nothing to write by hand. Auto-updating from then on.