Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
jaryszek
Resident Rockstar
Resident Rockstar

How to update shared expression automatically?

Hello,

 

How to update shared expression in the semantic model on DirectLake over the OneLake programmatically?

 

jaryszek_0-1773049111483.png

 

 

Best,
Jacek

1 ACCEPTED 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.

View solution in original post

3 REPLIES 3
v-hashadapu
Community Support
Community Support

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.

Semantic model connectivity and management with the XMLA endpoint in Power BI - Microsoft Fabric | M...

Tabular Object Model (TOM) | Microsoft Learn

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.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.