C# Script Library: Beginner Scripts
Applies to:
- ✔Tabular Editor 2.x
- ✔Tabular Editor 3.x
These are more basic scripts that are easy to understand or modify. They have a defined scope and limited complexity; you don't need a reasonable knowledge of the C# language to use, understand and modify these scripts. They are thus a good place to start when beginning to author C# Scripts in Tabular Editor.
Script Name |
Purpose | Use-case |
---|---|---|
Count Table Rows | Evaluates a COUNTROWS ( 'Table' ) of a selected table. | When you want to check how many rows are in a table, or if it's been loaded. |
Count Model Objects | Counts all the different objects by type in a model. | When you need an overview of the model contents or want to count objects by type. |
Create Sum Measures from Columns | Create SUM ( 'Table'[Column] ) measures from any selected column. | When you have many columns in a new table / model and must make many measures at once. |
Create M Parameter | Create a new M Parameter in 'Shared Expressions' | When you want to create a parameter to use in other Power Query queries (M Partitions / Shared Expressions). |
Edit Hidden Partitions | Reveals the properties of hidden partitions in Calc. Groups & Calc. Tables | When you need to see or edit the TOM properties of these hidden partitions. |
Find & Replace in Selected Measures | Searches for a substring in the DAX of selected measures, replacing with another substring. | When you need to quickly find/replace values in multiple DAX measures (i.e. CALCULATE filter or broken object references). |
Create Measure Table | Create a measure table | When you want to create an empty table to use as an organizing measure table |
Create Table Groups | Organize the model into Table Groups | When you want to have an automatic organization of your tables using the table group feature of Tabular Editor 3 |
Format Numeric Measures | Formats the chosen measures | When you want to quickly apply a format string to the currently selected measures |
Show Data Source Dependencies | Shows dependencies for data sources | For explicit (legacy) data sources it can be hard to know exactly where they are used. This script shows you which partition reference the chosen data source |
Create Field Parameters | Quickly create a field parameter table | Choose the objects that should be in the field parameter and the script will take care of the rest |