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
Anonymous
Not applicable

Switch measure not showing correct grund total - Help :)

Hello PowerBI community,

 

I have made this measure, that should give points:

Switch = SWITCH(TRUE(), SUM('Sales Finance'[Revex]) >VALUE(15000000),VALUE(1),
SUM('Sales Finance'[Revex])> VALUE(10000000),VALUE(2),VALUE(0))
 
The value you recieve should be summerized in the grand total, but the function just gives me 1 in grand total, because it is performering the logical test on the grand total of the revenue.
 
How can i get past this?
 
I have seen alot of posts regarding fixing the grand totalt, but not in context with the Switch function, please advice 🙂
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @Anonymous ,

 

It looks like your SWITCH statement is not right.

Switch = SWITCH(TRUE(), SUM('Sales Finance'[Revex]) >VALUE(15000000),VALUE(1),
SUM('Sales Finance'[Revex])> VALUE(10000000),VALUE(2),VALUE(0))
 
The highlighted condition will give everything a value = 1 as it is in 1st position in your switch statement; also your 2nd condition will return 1st condition output in the scenario where a value is > VALUE(10000000) and >VALUE(15000000)
 
Try writing BETWEEN statements for comparison. Something like:
Sales >= 10000 && Sales <= 50000 then VALUE1
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Greg_Deckler
Community Champion
Community Champion

@Anonymous This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@Anonymous , the formula is not clear. It can be

 

sumx('Sales Finance', if('Sales Finance'[Revex] >15000000,1 ,'Sales Finance'[Revex]> 10000000, 2,0))

 

or with some group by, first group and then compare, assumed -Aggcol

 

sumx(values('Sales Finance'[Aggcol]), if(sum('Sales Finance'[Revex]) >15000000,1 ,sum('Sales Finance'[Revex])> 10000000, 2,0))

 

 

Can you share sample data and sample output in table format?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors