Forum Discussion
How do you document your models?
- Anonymous10 years ago
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.
- 10 years ago
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!
Wow.....Will try that ImkeF ...but with 20 seperate queries rather than opening each in the advanced editor and copy & paste I assume I can do the "send a frown" and copy the M code section from that email ??? Hopefully.......Will try and let you know how i get on. Thanks for your continued support.
Hi David,
no, unfortunately send frown will not work with this one. The syntax of the query names is different.
But it's much easier than you think: Check your first query -> press Shift -> check last query -> rightclick mouse -> copy: done.
Much quicker than send frown.
Or If you have organized them in folders:: Just check the folders names and the copy will transfer all of them. No need to care about dependent queries - thay will come with it automatically.
This is btw also a very convenient method to copy queries across workbooks - also between PBI and Excel: Just instead of pasting them into a table, paste them into to editor.
No need to open the adanced editor at all (apart from pasting the query above that does the job :-)
- DavidMoss10 years agoAdvocate V
ImkeF I finally got around to testing your solution out. Thats some amazig code...thanks.
YOu just have to pay attention to the cut and pasting into the ClickGearWheelClearAndPaste applied step. (i see your code also does the demoted headers so we shouldn't do that step when copying and pasting drives your copied text to the header).
I see in your video that you cut and pasted the new Queries in what appeared Excel Power Query not from a Power BI EDit Queries UI.
I have just tried it from the Power BI UI and it is working. WOW
Only thing is most of my model is data connections only which are then appended into one big Master FAct table, so it is just showing the last append and the fact tables for some reason.
Have you used your solution on data connections only ?
BUT an amazing solution...I'd give you 10 votes if i could for this solution.
- ImkeF10 years agoCommunity Champion
Hi David, thanks!
What exactly do you mean with "dataconnections only"?
What does step "QueryNames" return?: Do you see the names of your "dataconnections only" queries in column "QueryName"?
Re your warning on the "Demoted Header": Good catch, but check out the next step "Filtered Rows 3": There I cater for both cases: First line of code in header or not. So you can paste in 2 different ways without running into a problem here.
- DavidMoss10 years agoAdvocate V
ImkeF Apologise for the fact that this dialogue continues just i think i am close to resolving this and want to persist to benefit from your hard work and hopefully your satisfaction.
By 'Data connections only' what i mean is that the query does not load the data to the data model but makes a connection only.
I often use this technique to prepare connections to data without actually loading the data when for example conneccting to multiple sources of data from different sources but with a similar data schema. Then with all the 'dataconnections only' prepared and tested i then 'Append' all the connections together to make 1 large fact tablewhich is loaded into the datamodel.
Thus i am thinking your code only sees the final fact table and not all the 'dataconnecctions only'.
What i hoped for was a sankey that showed the flow of queries from ALL the 'data connections only' into the fact table.
Looking at the code it is the 'parent' that is creating the issue as it returns a single parent (the last append table) for the fact table.
Anyway this is getting too complicated...if you have the patience then maybe we should take this offline ?
David - Anonymous6 years agoNot applicable
Hi!
Old but still interesting topic.
From my recent research with google, i could see these 3 ways to document a PBI project
- DataVizioner https://app.datavizioner.com/file
- DAX Studio https://exceleratorbi.com.au/getting-started-dax-studio/
- Azure Data Catalog https://docs.microsoft.com/en-us/azure/data-catalog/data-catalog-dsr
All above are to some extend interesting.
What i am still missing at the end is a real, simple possibility to comment the tables, M and DAX codes and then having a software that extract it in a nice manner. For example, if in DAX i would comment with
//.doc This measure is calculating the turnover by day
// 1234
The software should be able to keep the real comment (".doc.") and not consider the other one.
The idea would be that you write directly in the PBIX file your comments/properties, and then the software is able to export it directly either to Excel, Word or PDF to document it nicely.
What do you think about it? Does it make sense?
Do you have a better solution?
BR, G.