c-sharp-scripting

Solid

Writing and executing C# scripts and macros against Power BI semantic models using Tabular Editor 2/3. Automatically invoke when the user mentions "C# script", "Tabular Editor script", "TOM scripting", "MacroActions.json", "XMLA", or asks to "automate model changes", "bulk update measures", "create calculation groups", "write a macro", "format DAX expressions", "manage model metadata".

Data & Documents 654 stars 103 forks Updated 4 days ago GPL-3.0

Install

View on GitHub

Quality Score: 92/100

Stars 20%
94
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# C# Scripting for Tabular Editor Expert guidance for writing and executing C# scripts to manipulate Power BI semantic model metadata using Tabular Editor 2/3 CLI or the Tabular Editor IDE. ## When to Use This Skill Activate automatically when tasks involve: - Writing C# scripts for Tabular Editor - Bulk operations on model objects (measures, columns, tables) - Creating or modifying calculation groups - Managing model security (roles, RLS, OLS) - Formatting DAX expressions - Automating repetitive model changes - Querying model metadata via TOM API - Building interactive scripts with user input dialogs ## Critical - Every statement must end with `;` (semicolon required by C#) - Use double quotes `"` for strings and escape with `\` when needed - Use forward slashes `/` in DisplayFolder paths (auto-converted to `\`) - Always add `Info()` statements for debugging - script stops at error point - Test scripts on non-production models first - Changes are undoable with Ctrl+Z in the Tabular Editor UI ## C# Version Support | Environment | C# Version | Notes | |-------------|------------|-------| | **Tabular Editor 2** | Default compiler | Older C# syntax | | **Tabular Editor 3** | Roslyn | Supports up to C# 12 with VS2022 | | **TE2 with Roslyn** | Configurable | Set in File > Preferences > General | To use newer C# features in TE2, configure Roslyn compiler path in preferences. ## Default Imports and Assemblies ### Auto-Imported Namespaces Scripts automatically have th...

Details

Author
data-goblin
Repository
data-goblin/power-bi-agentic-development
Created
4 months ago
Last Updated
4 days ago
Language
C#
License
GPL-3.0

Similar Skills

Semantically similar based on skill content — not just same category

DevOps & Infrastructure Solid

te2-cli

CLI syntax reference for Tabular Editor 2 (TabularEditor.exe); deployment, scripting, BPA analysis, and CI/CD integration. Automatically invoke when the user mentions "TabularEditor.exe", TE2 CLI flags (-D, -S, -A, -B, -TMDL, -O, -C), or asks to "deploy a model via CLI", "set up CI/CD for Power BI", "automate model deployment", "run BPA from command line", "save model as TMDL".

654 Updated 4 days ago
data-goblin
Data & Documents Solid

connect-pbid

TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field parameters, query tracing, and DAX library package management (daxlib.org). Automatically invoke when the user mentions "Power BI Desktop", "Analysis Services port", "TOM", "ADOMD", "daxlib", "DAX library", "DAX UDF package", or asks to "connect to PBI Desktop", "query PBI Desktop with DAX", "modify PBI Desktop model", "add a measure to PBI", "capture visual queries", "create a field parameter", "validate DAX", "intercept DAX queries", "install daxlib", "add DAX SVG", "add IBCS".

654 Updated 4 days ago
data-goblin
AI & Automation Listed

powerbi-modeling

Power BI semantic models - DAX measures, star schemas, relationships, RLS, and performance tuning via MCP. Use when creating data models, writing DAX, or configuring table relationships in Power BI.

1 Updated today
bg-szy
Data & Documents Solid

tmdl

Direct TMDL file authoring and BIM-to-TMDL conversion for semantic models in PBIP projects. Automatically invoke when the user asks to "edit TMDL", "add a measure in TMDL", "TMDL syntax", "fix formatString", "fix summarizeBy", "TMDL indentation", "convert BIM to TMDL", "add a column description", "create a calculated column in TMDL", or mentions .tmdl file editing or BIM-to-TMDL migration.

654 Updated 4 days ago
data-goblin
AI & Automation Solid

powerbi-modeling

Power BI semantic modeling assistant for building optimized data models. Use when working with Power BI semantic models, creating measures, designing star schemas, configuring relationships, implementing RLS, or optimizing model performance. Triggers on queries about DAX calculations, table relationships, dimension/fact table design, naming conventions, model documentation, cardinality, cross-filter direction, calculation groups, and data model best practices. Always connects to the active model first using power-bi-modeling MCP tools to understand the data structure before providing guidance.

34,233 Updated today
github