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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
jaryszek
Super User
Super User

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
Fabric Data Days is here Carousel

Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

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.