Forum Discussion
Using Range of Values with SWITCH(TRUE Function
- 7 months ago
Hi rbowen,
In DAX, you must define ranges using logical operators (&&) and remember that percentages are decimal values (50% = 0.5). Your middle condition should be written like this:
_perc >= 0 && _perc < 0.5
That will fix the syntax error and correctly evaluate the range inside SWITCH(TRUE()).
Savio Ferraz | Microsoft Learning Consulting | Google Certified Trainer and Microsoft Certified Educator
Did my answer help? Mark my post as a solution or like it if you found it useful.
Hi rbowen,
In DAX, you must define ranges using logical operators (&&) and remember that percentages are decimal values (50% = 0.5). Your middle condition should be written like this:
_perc >= 0 && _perc < 0.5
That will fix the syntax error and correctly evaluate the range inside SWITCH(TRUE()).
Savio Ferraz | Microsoft Learning Consulting | Google Certified Trainer and Microsoft Certified Educator
Did my answer help? Mark my post as a solution or like it if you found it useful.
I knew the && had to figure in there somehow. The piece I was missing was using the _perc after the &&. That worked perfectly, many thanks Savio!