/powerbi-master:tmdl-masteryfrom powerbi-master
Provides TMDL syntax reference, folder-layout templates, serialization patterns, and Git CI/CD integration for Power BI semantic models at compatibility level 1200+. Automatically activates when writing or editing TMDL files.
Ships in powerbi-master. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
TMDL reference for language syntax, folder structure, object types, expressions, serialization API, CI/CD, and deployment. TMDL is the human-readable, source-control-friendly format for Power BI and Analysis Services semantic models at compatibility level 1200+.
| Aspect | Status (as of April 2026) |
|---|---|
| TMDL language GA | GA since August 2024 -- no longer preview |
| TMDL view in Power BI Desktop | GA -- semantic highlighting, autocomplete, code actions, diff preview, compatibility prompts |
| TMDL as default PBIP semantic-model format | Default -- model.bim is the legacy BIM format; new PBIP projects write definition/*.tmdl files |
| Fabric Git integration | Exports semantic models as TMDL (not TMSL/BIM) |
| TMSL / BIM | Not deprecated -- still supported for XMLA scripting commands and tools that require JSON. Use TMDL for source control, TMSL for XMLA createOrReplace command scripting |
| Compatibility level | 1550+ recommended; 1601+ required for some newer properties (e.g., formatStringDefinition, calculation group multi/empty selection expressions) |
| Tabular Editor 2 (free) | TMDL read/write support (2.17+) |
| Tabular Editor 3 (paid) | Full TMDL IDE with DAX debugger and diagram view |
| VS Code TMDL extensions | Microsoft analysis-services.TMDL and community CPIM.TMDL-language-support (DAX + M highlighting, code actions, formatting, breadcrumbs) |
| Report Server | No TMDL support -- continues to use legacy PBIX binary format |
Bottom line: Use TMDL for new Power BI / Fabric semantic models under source control. Retain TMSL for XMLA scripting or tools that require model.bim.
| Aspect | TMDL (.tmdl folder) | TMSL / BIM (model.bim) |
|---|---|---|
| Format | YAML-like text, indentation-based | Single JSON file |
| Files | One file per table, role, culture, perspective | One monolithic file |
| Git friendliness | Excellent -- granular diffs, minimal merge conflicts | Poor -- entire model in one diff |
| Human readability | High -- minimal delimiters, DAX/M inline | Low -- escaped JSON strings |
| Tooling | VS Code extension, TMDL view in Desktop, Tabular Editor 3 | Any JSON editor, Tabular Editor 2/3 |
| API | TmdlSerializer (.NET) | JsonSerializer (.NET), TMSL commands |
| Migration | Can convert from BIM via Tabular Editor or Desktop | Default legacy format |
When to use TMDL: Any new source-controlled, CI/CD, or team PBIP project.
When to use TMSL/BIM: Legacy projects, Report Server (no TMDL support), or tools that only accept BIM.
Declare objects by specifying the TOM object type followed by its name:
model Model
culture: en-US
table Sales
measure 'Sales Amount' = SUM(Sales[Amount])
formatString: $ #,##0
column 'Product Key'
dataType: int64
sourceColumn: ProductKey
summarizeBy: none
Key rules:
'My ''Special'' Table'Properties use colon delimiter; expressions use equals delimiter:
column Category
dataType: string /// colon for non-expression properties
sortByColumn: 'Cat Order' /// colon for object references
isHidden /// boolean shortcut (true implied)
isAvailableInMdx: false /// explicit boolean
measure Total = SUM(Sales[Amount]) /// equals for default expression
formatString: $ #,##0 /// colon for properties after expression
Text property values: Leading/trailing double-quotes optional and auto-stripped. Required if value has leading/trailing whitespace. Escape internal double-quotes by doubling them.
| Object Type | Default Property | Language |
|---|---|---|
| measure | Expression | DAX |
| calculatedColumn | Expression | DAX |
| calculationItem | Expression | DAX |
| partition (M) | Expression | M |
| partition (calculated) | Expression | DAX |
| tablePermission | FilterExpression | DAX |
| namedExpression | Expression | M |
| annotation | Value | Text |
| jsonExtendedProperty | Value | JSON |
Default properties use equals (=) on the same line or as multi-line expression on the following lines.
/// Single-line expression
measure 'Sales Amount' = SUM(Sales[Amount])
/// Multi-line expression (indented one level deeper than parent properties)
measure 'YoY Growth %' =
VAR CurrentSales = [Sales Amount]
VAR PYSales = CALCULATE([Sales Amount], SAMEPERIODLASTYEAR('Date'[Date]))
RETURN DIVIDE(CurrentSales - PYSales, PYSales)
formatString: 0.00%
/// Triple-backtick block for verbatim content (preserves whitespace exactly)
partition 'Sales-Part' = m
mode: import
source = ```
let
Source = Sql.Database("server", "db"),
Sales = Source{[Schema="dbo",Item="Sales"]}[Data]
in
Sales
```
Expression rules:
/// This table contains all sales transactions
/// Updated daily via incremental refresh
table Sales
/// Total revenue across all product lines
measure 'Sales Amount' = SUM(Sales[Amount])
Triple-slash comments above an object become its TOM Description property. No whitespace between description block and object type keyword.
Reference another TMDL object or define collection ordering:
/// In model.tmdl -- defines table ordering for deterministic roundtrips
model Model
culture: en-US
ref table Calendar
ref table Sales
ref table Product
ref table Customer
ref culture en-US
ref culture pt-PT
ref role 'Regional Manager'
Rules: Objects referenced but missing their file are ignored on deserialization. Objects with files but no ref are appended to collection end.
definition/
database.tmdl # Database properties (compatibilityLevel, etc.)
model.tmdl # Model properties, ref declarations
relationships.tmdl # All relationships
expressions.tmdl # Shared/named expressions (Power Query parameters)
functions.tmdl # DAX user-defined functions
dataSources.tmdl # Legacy data sources
tables/
Sales.tmdl # Table + all its columns, measures, partitions, hierarchies
Product.tmdl
Calendar.tmdl
roles/
RegionalManager.tmdl # Role definition with permissions and members
Admin.tmdl
cultures/
en-US.tmdl # Translations for all objects in this culture
pt-PT.tmdl
perspectives/
SalesView.tmdl # Perspective definition
One file per table, role, culture, and perspective. All inner metadata (columns, measures, partitions, hierarchies) lives inside the parent table file.
Apply changes to a live semantic model using the TMDL view in Power BI Desktop:
createOrReplace
table 'Time Intelligence'
calculationGroup
precedence: 1
calculationItem Current = SELECTEDMEASURE()
calculationItem YTD =
CALCULATE(SELECTEDMEASURE(), DATESYTD('Calendar'[Date]))
calculationItem PY =
CALCULATE(SELECTEDMEASURE(), SAMEPERIODLASTYEAR('Calendar'[Date]))
column 'Time Calc'
dataType: string
sourceColumn: Name
sortByColumn: Ordinal
column Ordinal
dataType: int64
sourceColumn: Ordinal
summarizeBy: none
Only one command verb per script execution. The createOrReplace command creates or replaces specified objects and all descendants.
TMDL uses strict whitespace indentation with a default single tab per level:
table, measure, column)dataType, formatString)Database-level and model-level direct children (table, relationship, role, culture, perspective, expression) do not require indentation since they are implicitly under the root. Incorrect indentation produces a TmdlFormatException.
using Microsoft.AnalysisServices.Tabular;
// Serialize model to TMDL folder
TmdlSerializer.SerializeDatabaseToFolder(database, @"C:\output\model-tmdl");
// Deserialize TMDL folder back to TOM
var db = TmdlSerializer.DeserializeDatabaseFromFolder(@"C:\output\model-tmdl");
// Serialize single object to string
string tmdl = TmdlSerializer.SerializeObject(table.Measures["Total Sales"]);
NuGet package: Microsoft.AnalysisServices.NetCore.retail.amd64 (or .NET Framework equivalent)
Error types: TmdlFormatException (invalid syntax) and TmdlSerializationException (valid syntax but invalid TOM metadata). Both include Document, Line, and LineText properties.
Before deploying any TMDL you've generated, run the four-layer validation pipeline from the powerbi-master:validation-testing skill:
TmdlSerializer.DeserializeDatabaseFromFolder catches TmdlFormatException (bad indentation, invalid keywords)TmdlSerializationException (invalid property combinations) and model.Validate() catches dangling references-A switch or semantic-link-labs.run_model_bpa runs the standard Microsoft BPA rule setmodel.Validate().Errors plus custom Tabular Editor C# scripts catch sortByColumn / measure-references-column issuesThe validation-testing skill provides ready-to-run recipes (C#, Python, GitHub Actions YAML) for each layer. Always validate before recommending a deploy.
The TMDL view is an integrated code editor inside Power BI Desktop for scripting semantic-model changes. As of the 2026 release wave its feature set includes:
formatStringDefinition), Desktop prompts to upgrade automaticallyTMDLScripts/ folder in PBIP projects (one file per tab)createOrReplace; multi-select with Ctrl before draggingsourceColumn (Power Query editor still shows the source name)fact_, dim_) or case changesLimitation: Desktop does not hot-reload TMDL files changed externally. After editing .tmdl files in VS Code, restart Power BI Desktop to pick up the changes.
For scripting semantic models from Python without a .NET toolchain, use semantic-link-labs (PyPI: semantic-link-labs) inside a Fabric notebook. It provides a Pythonic wrapper over TOM:
%pip install semantic-link-labs -q
import sempy_labs as labs
from sempy_labs.tom import connect_semantic_model
with connect_semantic_model(dataset="SalesModel", workspace="Sales-Dev", readonly=False) as tom:
# Add a measure
tom.add_measure(
table_name="Sales",
measure_name="Sales Amount",
expression="SUM(Sales[Amount])",
format_string="$ #,##0.00",
display_folder="Revenue",
)
# Add an incremental refresh policy
tom.add_incremental_refresh_policy(
table_name="Sales",
column_name="OrderDate",
start_date="2020-01-01T00:00:00",
end_date="2025-12-31T00:00:00",
incremental_granularity="Day",
incremental_periods=30,
rolling_window_granularity="Month",
rolling_window_periods=36,
)
# tom.save_changes() is called automatically on context exit
See references/tmdl-programmatic-python.md for a full cookbook.
references/tmdl-syntax-reference.md -- Complete TMDL syntax and grammar reference with all object types, properties, and expression rulesreferences/tmdl-examples-cookbook.md -- Copy-pasteable TMDL examples for every object type: tables, columns, measures, partitions, relationships, roles, perspectives, cultures, calculation groups, hierarchies, KPIs, annotations, and field parametersreferences/tmdl-cicd-patterns.md -- CI/CD pipelines, Git integration, deployment patterns, Tabular Editor CLI, Azure DevOps and GitHub Actions workflows, and merge conflict strategiesreferences/tmdl-programmatic-python.md -- semantic-link-labs / SemPy TOM scripting from Fabric Python notebooks: measures, calc groups, incremental refresh, RLS, Direct Lake, BPA, and model export patternspowerbi-master:validation-testing -- Validate TMDL artifacts before deployment: TmdlSerializer parser, TOM Validate, BPA via Tabular Editor CLI / semantic-link-labs, custom C# rule scriptscreateOrReplace command documentationWhat SKILL.md sets; muted values are Claude Code's defaults
10 skills in this plugin
/dax-masteryDAX (Data Analysis Expressions) mastery for Power BI semantic models.
PROACTIVELY activate for: (1) writing DAX measures or calculated columns, (2) CALCULATE, FILTER, ALL, REMOVEFILTERS context-modification functions, (3) understanding filter context vs row context vs context transition, (4) time intelligence (SAMEPERIODLASTYEAR, DATEADD, YTD/MTD, TOTALYTD, DATESBETWEEN), (5) iterators (SUMX, AVERAGEX, FILTER), (6) variables (VAR/RETURN) and DAX optimization, (7) calculation groups, field parameters, and visual calculations, (8) WINDOW/INDEX/OFFSET/ORDERBY/PARTITIONBY/MATCHBY (window functions), (9) DAX user-defined functions (UDF), (10) DAX patterns for ratios, running totals, ranking.
Provides: measure templates, time-intelligence patterns, optimization techniques (variables, FILTER vs CALCULATETABLE), context-transition explainers, and reference for window functions and calculation groups.
/deployment-adminPower BI deployment, CI/CD, governance, and administration.
PROACTIVELY activate for: (1) Power BI deployment pipelines (Service deployment pipelines, fabric-cicd, custom workflows), (2) CI/CD for Power BI via GitHub Actions or Azure DevOps, (3) workspace management and roles, (4) row-level security (RLS) and object-level security (OLS), (5) capacity management (Premium, PPU, Fabric SKUs F2-F2048), (6) tenant settings and governance, (7) Power BI Report Server deployments, (8) service principal setup for automation, (9) data-gateway management.
Provides: deployment-pipeline templates, GitHub Actions and Azure DevOps YAML, RLS/OLS implementation patterns, capacity sizing guidance, and service-principal auth recipes.
/fabric-integrationMicrosoft Fabric integration with Power BI semantic models.
PROACTIVELY activate for: (1) Microsoft Fabric platform tasks, (2) Direct Lake mode and OneLake connectivity, (3) Fabric lakehouse, warehouse, KQL Database, Eventstream, Data Activator, (4) Dataflow Gen2 ETL, (5) Fabric notebooks (PySpark, Spark SQL, semantic-link), (6) Fabric workspace and capacity (F-SKU) management, (7) delta tables and V-Order optimization, (8) medallion architecture (bronze/silver/gold), (9) Semantic Link / sempy / semantic-link-labs Python workflows, (10) Direct Lake fallback rules and mixed mode.
Provides: Direct Lake setup, Fabric capacity sizing, lakehouse-to-semantic-model patterns, sempy/semantic-link-labs recipes, and end-to-end medallion architecture templates.
/performance-optimizationPower BI performance optimization for slow reports, models, and queries.
PROACTIVELY activate for: (1) report is slow or visuals take forever to load, (2) DAX Studio and VertiPaq Analyzer profiling, (3) Performance Analyzer in Power BI Desktop, (4) optimizing slow DAX measures, (5) slow visuals diagnosis, (6) aggregations and composite-model tuning, (7) query reduction techniques (visual settings, top N), (8) model size reduction (cardinality, calculated columns, summary tables), (9) VertiPaq compression tuning, (10) Direct Lake performance and fallback rules, (11) large-dataset (10GB+) optimization.
Provides: profiling workflow with DAX Studio, VertiPaq compression checklist, aggregation-table patterns, model-size reduction techniques, and end-to-end performance investigation playbook.
/powerbi-coreCore Power BI data modeling, source connectivity, and platform fundamentals.
PROACTIVELY activate for: (1) Power BI data modeling and star-schema design, (2) relationships (active/inactive, bidirectional, USERELATIONSHIP), (3) data-source selection (DirectQuery vs Import vs Direct Lake vs composite), (4) incremental refresh setup, (5) gateway configuration (on-prem and VNet gateways), (6) streaming datasets and push-data scenarios, (7) Dataflow Gen2 basics, (8) Power BI common gotchas and pitfalls (bidirectional filtering, AutoExist, blank-row), (9) workspace identity and OAuth2 / service-principal auth, (10) semantic model architecture review.
Provides: star-schema templates, mode-selection matrix, incremental refresh recipe, gateway setup steps, and a common-gotchas reference.
/power-query-mPower Query M language for ETL, transformations, and connector authoring.
PROACTIVELY activate for: (1) writing Power Query M code, (2) query folding and Native Query verification, (3) data transformations (merge, append, pivot, unpivot, split column), (4) custom connector development, (5) Power Query parameters and dynamic source patterns, (6) performance optimization (folding, query reduction, partition strategy), (7) Table.TransformColumns, List.Generate, Record.Field functions, (8) error handling in M (try/otherwise, error records), (9) mashup engine internals, (10) ETL pipelines from folder/SharePoint/database sources.
Provides: M language reference, query-folding diagnosis, transformation recipes, dynamic source patterns, error-handling templates, and performance tuning techniques.
npx claudepluginhub josiahsiegel/claude-plugin-marketplace --plugin powerbi-masterOther plugins' skills for the same job