Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Solved! Go to Solution.
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! | |
#proudtobeasuperuser | |
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! | |
#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! | |
#proudtobeasuperuser | |
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
15 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
22 | |
11 | |
10 | |
10 | |
8 |