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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

Switch function not working

I have an interesting problem. To date I have successfully applied the SWITCH function to SUM measures based on a tables containing the name of the measure.

 

However there are two measures that pull through blank and I cannot figure out why as when I drop the individual measures into a column they work. Perplexing as every other measure (over 50) works

 

'Measure Test' table (Title is 'Test Measures'):

Total (Scope 1+2) Emissions Intensity per EUR million Sales (t/EUR million sales) (PVA)

Total (Scope 1+2) Emissions Intensity per USD million Sales (t/USD million sales) (PVA)

 

Measure Calculation:

 

Weighted Average Measure =
SWITCH(TRUE(),
"Total (Scope 1+2) Emissions Intensity per EUR million Sales (t/EUR million sales) (PVA)"
IN ALLSELECTED('Measure Test'[Test Measures]),
SUM('Master Table'[Total (Scope 1+2) Emissions Intensity per EUR million Sales (t/EUR million sales) (PVA)]),
"Total (Scope 1+2) Emissions Intensity per USD million Sales (t/USD million sales) (PVA)"
IN ALLSELECTED('Measure Test'[Test Measures]),
SUM('Master Table'[Total (Scope 1+2) Emissions Intensity per USD million Sales (t/USD million sales) (PVA)])
)
1 ACCEPTED SOLUTION

So, this is quite strange. I was messing around this morning.

 

I double checked the names of the respective measures and the formula. Still not working.

 

I then renamed the measures (slightly different) and altered the formula. It now works, I don't understand why.

View solution in original post

2 REPLIES 2

So, this is quite strange. I was messing around this morning.

 

I double checked the names of the respective measures and the formula. Still not working.

 

I then renamed the measures (slightly different) and altered the formula. It now works, I don't understand why.

v-easonf-msft
Community Support
Community Support

Hi, @knowledgegarage 

If a BLANK value is returned, this means there are no matches. Please recheck each condition for incorrect measure name.

Also, see if feature  field parameter  in the new version of PowerBI can work for you.

veasonfmsft_1-1657503447883.png

veasonfmsft_3-1657503451578.png

 

Best Regards,
Community Support Team _ Eason

 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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