cityofaustin / atd-data-tech

Austin Transportation Data & Technology Services
16 stars 2 forks source link

[Power BI] Create Data Dictionary #16898

Closed susannegov closed 3 weeks ago

susannegov commented 1 month ago

See #16880

Steps

I have made the data dictionary for columns and measures on the excel sheet. It's pulled from the description in the Power BI file itself. There are definitely a couple that could be better, but the most important ones - such as the measures are done sufficient. Most are copied from the open data portal

susannegov commented 1 month ago

See the page on setting up Best Practice Rules from Power BI blog post: https://powerbi.microsoft.com/en-ca/blog/best-practice-rules-to-improve-your-models-performance/

Requirements

Steps

string path = System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData); string url = "https://raw.githubusercontent.com/microsoft/Analysis-Services/master/BestPracticeRules/BPARules.json"; string downloadLoc = path+@"\TabularEditor\BPARules.json"; w.DownloadFile(url, downloadLoc);

![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/6784d334-09bb-4534-94cd-c0193cd1cefe)

 - Close and reopen Tabular Editor. It should show how many BP Issues on the bottom bar
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/3dfac929-4905-4e89-b99e-98d714d5c40f)
- Click on the blue hyperlink for BP Issues. It should open to a new window called "Best Practice Analyzer" (BPA)
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/d71288a2-18cd-4371-a8f2-4b1e4f4ffb0e)
- Fill out any columns/measures with missing descriptions listed in the BPA
   - `[Maintenance] Visible objects with no description` 
   - You can fill it on Tabular Editor or in the PBI desktop file. I found tabular editor to be slightly easier. 
      - In the left pane, expand Tables > expand the table missing description > select column/measure
      - On bottom right pane, scroll to Basic > Description and fill out description. This will be used to generate data dictionary
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/2027e789-6cd9-4e07-b78f-f73abe66366f)
- After descriptions are filled out on the table, click save 
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/1a4de65f-171e-4715-ad9d-63e233b10e33) and close in Tabular Editor.
- Save your Power BI desktop file. Keep it open since it will be needed for DAX Studio
## In DAX Studio
- Open DAX Studio. You should be able to connect to your Power BI desktop file as long as it is open. 
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/ac47c0c8-5289-4352-81b6-44fc67f5faba)
- For Columns data dictionary, copy/paste

SELECT [DIMENSION_UNIQUE_NAME] as TABLE_NAME,[LEVEL_NAME] as LABEL_NAME,[DESCRIPTION] FROM $SYSTEM.MDSCHEMA_LEVELS WHERE [LEVEL_ORIGIN] <> 1 -- excludes User Defined Hierarchies AND [LEVEL_NUMBER] = 1 -- excludes the (All) level AND [CUBE_NAME] = 'Model'

- Select "Run" and check to see if correct by setting the output to "Results"
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/54031faa-1249-4694-99a6-e5fbd91f0b8a)
- If it looks good, change your output to "Static" with the excel icon. It will export the results as an excel table.
![image](https://github.com/cityofaustin/atd-data-tech/assets/31259724/edeff3b2-3c35-4bcf-98d2-f3545efb43e8)
- For Measure descriptions, copy/paste

SELECT [MeasureGroup_Name] AS TABLE_NAME, [MEASURE_NAME] AS LABEL_NAME, [DESCRIPTION] FROM $SYSTEM.MDSCHEMA_MEASURES


- Select "Run" and check to see if correct by setting the output to "Results"
- If it looks good, change your output to "Static" with the excel icon. It will export the results as an excel table.