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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.