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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

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.