Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to establish the value of 5 conditions, how to do using DAX?
Exemple:
Group 1 = "18-27",
Group 2 = "28-35",
Group3 = "36-43",
Group 4 = "44-50",
Group 5 = "50+"
I make this formula but is incorrect:
Age Group = IF(AND([Age]>17 [Age]<28),"18-27",
IF(AND([Age]>27, [Age]<36),"28-35",
IF(AND([Age]>35, [Age]<44),"36-43"
IF(AND([Age]>43, [Age]<51),"44-50",
IF([Age]>50,"50+", BLANK())
))))
I Can Help?
Solved! Go to Solution.
look at using the switch statement with true
here is the whole article
https://powerpivotpro.com/2012/06/dax-making-the-case-for-switch/
example taken from above but this is the one you would need to use)
SWITCH(TRUE(),
AND([Fund Balance]>=0, [Fund Balance]<=10000), “Up to $10,000”,
AND([Fund Balance]>=10001, [Fund Balance]<=50000), “$10,001 to 50,000”,
AND([Fund Balance]>=50001, [Fund Balance]<=100000), “$50,001 to 100,000”,
AND([Fund Balance]>=100001, [Fund Balance]<=500000), “$100,001 to 500,000”,
AND([Fund Balance]>=1500001, [Fund Balance]<=1000000), “$500,001 to 1,000,000”,
“greater than $1,000,000”
)
Proud to be a Super User!
look at using the switch statement with true
here is the whole article
https://powerpivotpro.com/2012/06/dax-making-the-case-for-switch/
example taken from above but this is the one you would need to use)
SWITCH(TRUE(),
AND([Fund Balance]>=0, [Fund Balance]<=10000), “Up to $10,000”,
AND([Fund Balance]>=10001, [Fund Balance]<=50000), “$10,001 to 50,000”,
AND([Fund Balance]>=50001, [Fund Balance]<=100000), “$50,001 to 100,000”,
AND([Fund Balance]>=100001, [Fund Balance]<=500000), “$100,001 to 500,000”,
AND([Fund Balance]>=1500001, [Fund Balance]<=1000000), “$500,001 to 1,000,000”,
“greater than $1,000,000”
)
Proud to be a Super User!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |