/Tabular

Useful code for tabular modeling and automation

Primary LanguageC#MIT LicenseMIT

Tabular

This repo is a collection of useful code for automating processes within tabular modeling. All of these scripts are to be executed in Tabular Editor so make sure to download and install it.

For more information on these scripts, check out my blog Elegant BI.

Run this script in Tabular Editor to create an automated data dictionary. This script works for Analysis Services, Azure Analysis Services, and Power BI Premium models (XMLA R/W endpoints enabled).

Run this script in Tabular Editor against a live-connected model to quickly make a list of all relationships that contain a blank row in the 'to-table'.

Run this script in Tabular Editor against a live-connected model to cancel the data refresh of that model.

Metadata Import - Perspectives

Run this script to automatically update the perspectives in your model (or add new perspectives). This script coordinates with the output text file from the Metadata Export script.

Metadata Import - Translations

Run this script to automatically update the translations in your model (or add new translations). This script coordinates with the output text file from the Metadata Export script.

Running this script opens a program within Tabular Editor that allows you to create or modify perspectives akin to the way it is done in SQL Server Development Tools (SSDT). It also gives you a tree-view of all the objects that are in a perspective relative to all the objects in the model.

Run this script against a live-connected model to save Vertipaq Analyzer statistics as annotations on model objects. These annotations may be referenced to create Best Practice Analyzer rules for your model. See the link below for more info on Tabular Editor's Best Practice Analyzer.

Note: If running this script against a Power BI Desktop model (using Tabular Editor as an External Tool), you must select the following setting within Tabular Editor:

File -> Preferences -> Features -> Allow Unsupported Power BI features (experimental)
  • Model: Model Size

  • Tables: Row Count; Table Size; Table Size as a Percentage of the Model Size

  • Partitions: Record Count; Segment Count; Records Per Segment

  • Columns: Cardinality; Column Hierarchy Size; Column Size; Data Size; Dictionary Size; Column Size as a Percentage of the Table Size; Column Size as a Percentage of the Model Size

  • Hierarchies: User Hierarchy Size

  • Relationships: Relationship Size; Max From Cardinality; Max To Cardinality

This script creates the same annotations as the Vertipaq Annotations script. The only difference is that this script loads the Vertipaq Analyzer data from a Vertipaq Analyzer (.vpax) file.