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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bryannvpwarrant
Frequent Visitor

Switch statement not giving total

Hello - I have a switch statement for my customers based on total sales for example if they meet $20k in sales they get commission of 3k. So I wrote a switch statement see below. Everything looks good but it doesnt total in the table  and when I tried to enter sumx in the switch statement I get error please assist.

"

Payout = SWITCH(
TRUE(),
Contract_Header[Total Sales] <= 19999 && Contract_Header[Total Sales] >= 0, VALUE( "0 ") ,
Contract_Header[Total Sales] <= 39999 && Contract_Header[Total Sales] >= 20000, VALUE( "3000 ") ,
Contract_Header[Total Sales] <= 99999 && Contract_Header[Total Sales] >= 40000, VALUE( " 6000 "),
Contract_Header[Total Sales] <= 999999 && Contract_Header[Total Sales] >= 100000, VALUE( " 7500 "))"

bryannvpwarrant_0-1649502969576.png

 

1 ACCEPTED SOLUTION
Whitewater100
Solution Sage
Solution Sage

Hi:

I can't see what your column is associated with the results. If it is customer and your table column in this visual is Customer[Name] you should be able to do a measure:

Fix Total = SUMX(VALUES(Customer[Name]), [Payout]))

I hope this solves your question..

View solution in original post

3 REPLIES 3
Whitewater100
Solution Sage
Solution Sage

Hi:

I can't see what your column is associated with the results. If it is customer and your table column in this visual is Customer[Name] you should be able to do a measure:

Fix Total = SUMX(VALUES(Customer[Name]), [Payout]))

I hope this solves your question..

Thank you that worked!!! 

Great! Your welcome..

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.