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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
mm456
Frequent Visitor

Automate a calculated column with PowerShell

Hi all,

 

I'm trying to automate a PowerBi report that I have published that uses parameters to change the values for data coming from AzureBlobs.  I have one report and I'm using powershell to deploy changes to various workspaces such as changing the title of the report. However, I have a calculated called Area (below) that checks for specific strings in another column and renames them.

 

Area = SWITCH (

    TRUE(),
    CONTAINSSTRING(Data[Service],"Dev"),"Test",
    CONTAINSSTRING(Data[Service],"demo"),"Demo",
     "Other"
    )

Since, I'm using multiple datasources and expect this column to change from time to time with different values thus the calculation must be done on the fly. How can I calcucate this field either using PowerShell or within PowerBI or any other suggestions?
 


Thanks,

Marl

1 REPLY 1
lbendlin
Super User
Super User

That's more something you would do with ALM Toolkit or Tabular Editor. You can ask them to script the action and then "borrow"  the XMLA and reuse it in your Powershell scripts.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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