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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Using Switch to Evaluate Column Values to Multiply Measures

I am working on a report that requires me to multiply a measure by 4 different peramiters based on a table column valup.  The equation that I would like to use is as follows: 

 

Measure = SWITCH(
                             TRUE(), 
                                   Cost[Cost Allocation] = "Building", Measure1[AVG Cost at New City] * 'Concept SF'[Peramerer Value],
                                   Cost[Cost Allocation] = "Site", Measure1[AVG Cost at New City] * 'Concept Acre'[Peramerer Value],  
                                   Cost[Cost Allocation] = "GC", Measure1[AVG Cost at New City] * 'Concept Duration'[Peramerer Value],
                                   Measure1[AVG Cost at New City] * 'Concept PGC Duration'[Peramerer Value])
The issue that I have is when I type this in as a measure I cant refferance the tabel Cost[Cost Allocation], there is an an image of the table below.  The end result is to have the above mentioned measure displayed in a table on a report.  Any sugestions on how to solve this issue?
 
Cost Table.JPG
 
Capture.JPG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , you should not use measure in a calculated column. the measure will not respond to the slicer value. User measures

 

Measure = SWITCH(
TRUE(),
max(Cost[Cost Allocation]) = "Building", Measure1[AVG Cost at New City] * 'Concept SF'[Peramerer Value],
max(Cost[Cost Allocation])= "Site", Measure1[AVG Cost at New City] * 'Concept Acre'[Peramerer Value],
max(Cost[Cost Allocation])= "GC", Measure1[AVG Cost at New City] * 'Concept Duration'[Peramerer Value],
Measure1[AVG Cost at New City] * 'Concept PGC Duration'[Peramerer Value])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , you should not use measure in a calculated column. the measure will not respond to the slicer value. User measures

 

Measure = SWITCH(
TRUE(),
max(Cost[Cost Allocation]) = "Building", Measure1[AVG Cost at New City] * 'Concept SF'[Peramerer Value],
max(Cost[Cost Allocation])= "Site", Measure1[AVG Cost at New City] * 'Concept Acre'[Peramerer Value],
max(Cost[Cost Allocation])= "GC", Measure1[AVG Cost at New City] * 'Concept Duration'[Peramerer Value],
Measure1[AVG Cost at New City] * 'Concept PGC Duration'[Peramerer Value])

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors