A few months ago, I chatted with colleagues about our Tabular Model. More specifically the lack of Tabular Model documentation. Since we were thinking about replacing our current model, I started to think about how to integrate documentation easily.
Having documentation is 1 thing, making sure it’s used is something completely different. And then we’re not even talking about keeping it up to date. My initial idea was to include the documentation task during the development phase. That said, time to get the thoughts into practice.
Recipe Overview
Preparation Time: 10 minutes
Ingredients
In this data recipe, I will explain how I came up with my solution in Power BI. But first things first, let’s talk about documentation needs.
Documentation requirements
To clarify the Tabular data model to the end users, we want to document the following things:
- Measures: document the business logic applied to the measures.
- Attributes: document where the attribute values come from, for example, which operational system.
To get this information documented, we could use a Word File, Excel File, or a webpage. Since we will be creating documentation for the Tabular Model that is used by our Power BI reports, why don’t we use Power BI as a documentation tool?
But how do we get our tabular model documentation included in Power BI?
In short, we use DMV’s. Before I explain what DMV’s are, let’s take a look at how I will be documenting my Tabular Model.
Tabular Model Documentation
I imported my Calendar table into my tabular model. Now, I want to let my end-users know what kind of information this table will contain. I can achieve this by using the Description field on the Calendar Table.
The “Description” field is not only available on the Table level. It’s available on a column level as well.
And not to forget the measure level.
DMV’s
Now that we know where we can input our documentation, we can take a look at how we can get this documentation out of the Tabular model. As mentioned before, we can use DMV’s for that.
It is not my intention to explain what DMV’s are exactly but let’s say that DMV’s are very powerful and useful views you can use.
In case you want to know everything about DMV’s, the following webpage is a good starting point: Dynamic Management Views (DMVs) in Analysis Services | Microsoft Learn
To create a report containing our documentation in Power BI, we will be using the following DMV’s:
DMV Name |
THEMA_PERSPECTIVES |
TMSCHEMA_TABLES |
TMSCHEMA_COLUMNS |
TMSCHEMA_MEASURES |
TMSCHEMA_PERSPECTIVE_TABLES |
TMSCHEMA_PERSPECTIVE_COLUMNS |
TMSCHEMA_PERSPECTIVE_MEASURES |
Power BI
Since we know which DMV’s to use, we can import these views into a Power BI Model.
As soon as we import the information we can create our Power BI Documentation Report. Since I wanted to have a search functionality in my report, I imported the Text Filter Visual in my report.
In the end, I came up with the first version of my Business Model Documentation in Power BI. This Power BI report allows users to choose the perspective they are looking at, and then to choose a specific folder if preferred. This is mainly added for users who connect to the Tabular Model by using Excel. For example, to get the information easily of a certain folder and the attributes/ measures that are included.
How do I get access to this report?
You can find my Power BI Documentation report on my GitHub account, which you can find by using the following URL: blogging/Power BI/Model Documentation at main · Oliviervs/blogging (github.com)
Useful Resources
Help – Which Attributes and measures can I combine from my Tabular Data Model?
Enjoy your cooking adventure!
Bon appétit!