Document your reports from a Fabric notebook

By now you have heard about Fabric notebooks, the semantic link and the INFO functions in DAX.
Let's combine them!

Related links:
https://data-marc.com/2021/02/18/trigger-a-single-table-to-refresh-in-the-power-bi-service/
https://powerbi.microsoft.com/en-us/blog/dax-query-view-introduces-new-info-dax-functions/
https://pbig.nl/media/jcxhj3tk/2024-03-09_exploring-semantic-link-for-power-bi-folks.pdf
https://github.com/microsoft/fabric-samples/blob/main/docs-samples/data-science/semantic-link-samples/powerbi_measures_tutorial.ipynb
https://learn.microsoft.com/en-us/fabric/data-science/tutorial-power-bi-measures

My solution is building on this blogpost https://amalbenrebai.substack.com/p/544 from
Amal Ben Rebai.

I added a few changes to the code in Amal's blog post, first I added the Displayfolder, then I filter out the hidden measures and the measures in the technical folder as we probably don't want the users to use them in their own analysis. I would not be able to see the structure of the measures without display folders, there are a lot of measures that are useless for self-service for example measures related to a specific visual, it is better to hide these or at least move them to the technical folder. The description field is very useful as that should help understanding the calculations, make sure to provide them, copilot also relies on these to provide you meaningful answers.

A further enhancement could be removing the comments inside the DAX measures. I think that DAX measures can expose sensitive information so I am not sure about if the code should be shared outside of the development team.

Summary
Using the semantic link in a Fabric Notebook you can create a spark dataframe with a combination of the INFO measures to help data analysis or for documentation purposes. The notebook is using the semantic model's Row-Level Security and the result table can be downloaded from the notebook. The notebooks should be shared via the new organisational app if you have a Fabric capacity.

Leave a Reply

Your email address will not be published. Required fields are marked *