cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ThomasDay Member
Member

How do you document your models?

Hello all,

 

I can see that my models will get complex fast--and code is very decentralized--being embedded in Queries, column adds, and measures (more maybe when you also look at visualizations)

 

How do you all document your code...perhaps make a data dictionary of computed cols and measures and the like?  Is there anything that auto does that?

 

Thanks,

Tom

PS: was just reading about corruption in models on this forum and it has me want to be smart, presuming that possible (on any level)

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: How do you document your models?

My documentation style is pretty low tech as these things go. Nothing automated but it's easy enough.

 

I write most of my columns and measures out in Notepad++ and then copy it into Power BI. The advantages here are 1) you can format your code nicely without trouble and 2) your documentation is half-done already. Especially if you comment your code as you go.

 

Beyond that it's mostly a matter of organizing the code and documenting the queries. For the queries, open the advanced editor and copy all that code. You can later recreate any query instantly by pasting that back into a blank query*.

 

For the documentation itself, my preference is to organize by tables. A brief description of the data represented, the query, a list of the columns and their data types, then the custom columns in alphabetic order and the measures, same.

 

I tend to create master datasets and use them each for several different reports, so I tend not to document the reports themselves very extensively. I just keep a changelog of requests that I get about them, because everyone around here likes to change their minds about what charts they want to see. One changelog per report, starting with a note about which dataset it's coming from.

 

I've had to recreate one lost report so far. The original took about a week, the recovery took about three hours, and to be fair I was watching a movie while I did it.

 

*Assuming in some cases that you've already established a connection and credentials with the data source from the machine you're working at.

 

 

Super User
Super User

Re: How do you document your models?

How to connect PBI to DAX Studio: http://exceleratorbi.com.au/getting-started-dax-studio/

incl. tons of other awesome stuff you can do with it!

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




22 REPLIES 22
Super User
Super User

Re: How do you document your models?

For now, I keep multiple copies of the pbix file in different locations. When I make changes I will only save it to one location to make sure that the file is good. After a couple of days or weeks, I update the other versions of the file. I have learned to always have a backup. If one craps out, I simply fall back to a back up and rewrite the last couple of calculations.

EDIT: Posted this on the wrong thread.

My models are documented using the DaxStudio to create an expression dictionary that is save separately from the file.

Super User
Super User

Re: How do you document your models?

My documentation style is pretty low tech as these things go. Nothing automated but it's easy enough.

 

I write most of my columns and measures out in Notepad++ and then copy it into Power BI. The advantages here are 1) you can format your code nicely without trouble and 2) your documentation is half-done already. Especially if you comment your code as you go.

 

Beyond that it's mostly a matter of organizing the code and documenting the queries. For the queries, open the advanced editor and copy all that code. You can later recreate any query instantly by pasting that back into a blank query*.

 

For the documentation itself, my preference is to organize by tables. A brief description of the data represented, the query, a list of the columns and their data types, then the custom columns in alphabetic order and the measures, same.

 

I tend to create master datasets and use them each for several different reports, so I tend not to document the reports themselves very extensively. I just keep a changelog of requests that I get about them, because everyone around here likes to change their minds about what charts they want to see. One changelog per report, starting with a note about which dataset it's coming from.

 

I've had to recreate one lost report so far. The original took about a week, the recovery took about three hours, and to be fair I was watching a movie while I did it.

 

*Assuming in some cases that you've already established a connection and credentials with the data source from the machine you're working at.

 

 

Super User
Super User

Re: How do you document your models?

Using Dax Studio to extract the measures: http://exceleratorbi.com.au/extract-calculated-fields-from-an-excel-workbook/

 

To extract all Queries at once, start sending a frown but don't send the mail:

http://www.thebiccountant.com/2016/01/30/visualize-query-dependencies-in-power-query-and-power-bi/

This also describes a technique that helps you visualize dependencies between complex queries.

 

If you have very many different measures and you want to visualize their dependencies under each other as well, you can use Sankey-diagramm as well: http://www.thebiccountant.com/2015/12/18/visualize-dependencies-between-your-dax-measures/

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




Super User
Super User

Re: How do you document your models?

@ImkeF The extract the query by sending a frown = Awesome!

Near SE WI? Join our PUG MSBIWI
ThomasDay Member
Member

Re: How do you document your models?

These are an absolute treasure trove of good stuff.  Two quick questions:

  • Is DAX Studios for Excel only--and it seemed to be looking for SQL server on install.  If it can be used for Power Bi, is it a stable product--enough so that you do your coding there and then push it or some such thing.  What a great project--do they keep up with PowerBi's dev pace?
  • And send the frown...ha!  Very cool!!

Tom

PS: the notepad++ is a very ingenious solution.  I use that already and should have figured that out.  Well done everyone and many many thanks

 

Super User
Super User

Re: How do you document your models?

How to connect PBI to DAX Studio: http://exceleratorbi.com.au/getting-started-dax-studio/

incl. tons of other awesome stuff you can do with it!

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Imke Feldmann

How to integrate M-code into your solution -- Check out more PBI- learning resources here -- Performance Tipps for M-queries




Super User
Super User

Re: How do you document your models?

Its really very tedious to document everything we do with the PBI files

 

For the Calculated Columns (C) and Measures (M) I keep a huge spreadsheet containing... 

 

Type --- Name --- Formula --- Data Type --- Format --- Home Table --- Etc...

C/M

 

It will be nice if they add something like the Manage Measures dialog-box in PowerPivot but with improved functionality

 

Where we can export to Excel a table like the above containing the information for ALL Measures in ALL tables

 

Even if its only for the Measures and includes only Name and Formula this would save us lots of time.

 

ThomasDay Member
Member

Re: How do you document your models?

I've downloaded DAX Studio and it looks great.  I love a programming environment where I can do debugging and documenting.  As a beginner, this will be a huge help.  Thank you, Tom

ThomasDay Member
Member

Re: How do you document your models?

I have installed and opened my pbix model in DAX Studios and it's very interesting.  I'm really looking forward to the accelerated learning not to mention the extraction/documenting of my work it will provide.  Thank you again @ImkeF for the links.  Tom