Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello,
How to update shared expression in the semantic model on DirectLake over the OneLake programmatically?
Best,
Jacek
Solved! Go to Solution.
Hi @jaryszek , Thank you for reaching out to the Microsoft Community Forum.
PowerShell can be used, but not through the standard Power BI PowerShell cmdlets. Those modules mainly cover administrative tasks and don’t support modifying semantic model metadata like shared expressions. To do this with PowerShell, you would still connect to the workspace XMLA endpoint and use the Tabular Object Model (TOM) from the Microsoft.AnalysisServices.Tabular .NET library within the script to update the expression and save the model.
Hi @jaryszek , Thank you for reaching out to the Microsoft Community Forum.
Shared expressions in a semantic model are part of the tabular model metadata, so they can’t be updated through OneLake or a DirectLake-specific API. Modify them programmatically through the XMLA endpoint, using TMSL scripts or the Tabular Object Model (TOM). XMLA endpoint allows external tools and applications to perform modeling and administrative operations that alter semantic model metadata, which includes objects like expressions. In practice this is the same mechanism used by tools such as Tabular Editor to edit semantic models in Microsoft Fabric / Power BI.
Thanks, what about PowerShell? Can it be done via this tool?
Hi @jaryszek , Thank you for reaching out to the Microsoft Community Forum.
PowerShell can be used, but not through the standard Power BI PowerShell cmdlets. Those modules mainly cover administrative tasks and don’t support modifying semantic model metadata like shared expressions. To do this with PowerShell, you would still connect to the workspace XMLA endpoint and use the Tabular Object Model (TOM) from the Microsoft.AnalysisServices.Tabular .NET library within the script to update the expression and save the model.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |