This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.