Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello I need some help with the following DAX Syntax.
I have a Measure [total qty] and need to get some DAX to do the following:
If [total qty] < 1000, Then Divide[total qty] by 1. If [total qty] < 5000 Then Divide [total qty] by 2, IF [total qty] < 50000, Then Divide [total qty] by 4, IF [total qty] > 50000 then Divide [total qty] by 6.
The multiple conditions are tripping me up.
Thank you
Solved! Go to Solution.
You can use the SWITCH function to avoid multiple IF statements - i.e
Your Measure = SWITCH(TRUE(),
[total qty] < 1000, Divide([total qty], 1),
[total qty] < 5000 Divide([total qty], 2),
[total qty] < 50000, Divide([total qty], 4),
[total qty] > 50000, Divide([total qty], 6)
)
You can use the SWITCH function to avoid multiple IF statements - i.e
Your Measure = SWITCH(TRUE(),
[total qty] < 1000, Divide([total qty], 1),
[total qty] < 5000 Divide([total qty], 2),
[total qty] < 50000, Divide([total qty], 4),
[total qty] > 50000, Divide([total qty], 6)
)
Vicki, you ROCK thank you so very much, this WORKS. I have spent the last 2 days trying to get it working. THANK YOU for being part of this great community.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 137 | |
| 102 | |
| 71 | |
| 67 | |
| 65 |