Exposing #shared construct in Azure Analysis Services (change DatabaseID accordingly)
This example shows how to expose the contents of Power Query's `#shared` intrinsic constant inside an Azure Analysis Services tabular model, turning the built-in M function and value registry into a queryable table. The workflow uses three XMLA/TMSL scripts: first, an XMLA `Create` command injects a shared expression named `SharedExpression` that returns `#shared`; second, a TMSL `create` operation defines a table with `Name` and `Value` string columns, pulling data through an M partition expression that references the injected shared expression; finally, a TMSL `refresh` command processes the new table. The result is then viewed with a DAX `evaluate` statement against the `SharedExpressionTable`, demonstrating a round-trip from M metadata to a usable relational structure. The code relies on the XMLA protocol, TMSL JSON APIs, and the M expression engine, with no external visualization library involved.
AI-generated description