Applies to:
SQL Server 2016 and later Analysis Services
Azure Analysis Services
Fabric/Power BI Premium
Tabular Model Scripting Language (TMSL) is the command and object model definition syntax for tabular data models at compatibility level 1200 or higher. TMSL communicates with Analysis Services through the XMLA protocol, where the XMLA.Execute method accepts both JSON-based statement scripts in TMSL as well as the traditional XML-based scripts in Analysis Services Scripting Language (ASSL for XMLA).
Key elements of TMSL:
Tabular metadata based on tabular model semantics.
A tabular model is composed of tables, columns, and relationships. Equivalent object definitions in TMSL are now, not surprisingly, tables, columns, relationships, and so forth. A new metadata engine supports these definitions.
Object definitions are structured as JSON instead of XML.
With the exception of how the payload is formatted (in either JSON or XML), both TMSL and ASSL are functionally equivalent in how they provide commands and metadata to XMLA methods used for server communication and data transfer.
How to use TMSL
The easiest way to explore TMSL scripting is using the CREATE, ALTER, DELETE, or Process commands in SQL Server Management Studio (SSMS) on a model you already know.
The following screenshot shows an abbreviated version of the schema, collapsed to show the major objects.
Scripting languages in Analysis Services
Analysis Services supports ASSL and TMSL scripting languages. Only tabular models created at the 1200 compatibility level or higher are described in TMS in JSON format.
Analysis Services Scripting Language (ASSL for XMLA) was the first scripting language, and is still the only scripting language for Multidimensional models and Tabular models at lower compatibility levels (1100 or 1103). In ASSL, tabular models at 110x are described in multidimensional terms, such as cube (for a model) and measuregroup (for a table).
Note
In [SQL Server Data Tools (SSDT), you can upgrade an earlier version tabular model to use TMSL by switching up its CompatibilityLevel to 1200 or higher. Remember that upgrade is irreversible. Prior to upgrading, back up your model in case you need the original version later.
The following table is the scripting language matrix for Analysis Services data models across different platforms/versions at specific compatibility levels.
Demonstrate methods and best practices that align with business and technical requirements for modeling, visualizing, and analyzing data with Microsoft Power BI.