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
abeirne
Helper II
Helper II

SWITCH function help (does not support comparing values of type true/false)

Hi I have a measure that is supposed to be determining whether certain values are met, and should sort them into either tiers 1, 2, 3, or 4. I am getting an error that says the switch function does not support comparing values of type text with values of type true/false. Could someone explain what I am doing wrong? Thank you. 

SA Anc/Car =
IF(
[ANC $/ Car SA] >= 43.50,
Switch( [ANC $/ Car SA],
[ANC $/ Car SA] <= 49.49, 1,
[ANC $/ Car SA] >= 49.50 && [ANC $/ Car SA] <= 55.99 , 2,
[ANC $/ Car SA] >= 56 && [ANC $/ Car SA] <= 65.99, 3,
[ANC $/ Car SA] >= 66.00, 4 , 0)
,0)
1 ACCEPTED SOLUTION
tackytechtom
Super User
Super User

Hi @abeirne ,

 

Could you try this? 🙂

SA Anc/Car =
IF(
[ANC $/ Car SA] >= 43.50,
Switch( TRUE,
[ANC $/ Car SA] <= 49.49, 1,
[ANC $/ Car SA] >= 49.50 && [ANC $/ Car SA] <= 55.99 , 2,
[ANC $/ Car SA] >= 56 && [ANC $/ Car SA] <= 65.99, 3,
[ANC $/ Car SA] >= 66.00, 4 , 0)
,0)

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

View solution in original post

3 REPLIES 3
tackytechtom
Super User
Super User

Hi @abeirne ,

 

Could you try this? 🙂

SA Anc/Car =
IF(
[ANC $/ Car SA] >= 43.50,
Switch( TRUE,
[ANC $/ Car SA] <= 49.49, 1,
[ANC $/ Car SA] >= 49.50 && [ANC $/ Car SA] <= 55.99 , 2,
[ANC $/ Car SA] >= 56 && [ANC $/ Car SA] <= 65.99, 3,
[ANC $/ Car SA] >= 66.00, 4 , 0)
,0)

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Yes the 'true' works! Would you be willing to explain why this works? Thank you for your help. 🙂

Hi @abeirne ,

 

I hope it's okay if I just post you some links that I think are great to read up on:
How To Use SWITCH True Logic Function In Power BI | Enterprise DNA

Power BI: Use DAX Switch Function to Make IF Functions Easier (pragmaticworks.com) (especially the video is great)

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.