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.
Hello,
I've been trying to create a IF conditional DAX where happen the below:
if X value is between 0 - 30 show me "0 - 30",
if X value is between 31 - 60 show me "31-60",
If X value is between 61 - 90 show me "61 - 90",
if X value is between 91 - 120 show me 91 - 120"
Any takers? 🙂
Thanks a lot!!
Solved! Go to Solution.
Hi,
@manuelfigueira
Switch is used to combine multiple IFs in one neat formula:
Column = SWITCH(TRUE(),
[Value]>= 0 && [Value]<=30,"0-30",
[Value]>=31 && [Value]<=60,"31-60",
[Value]>=61 && [Value]<=90,"61-90",
[Value]>=91 && [Value]<=120,"91-120"
)
Paul
Best
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly, Kudos is nice too.
I thought earlier your Column X is Text value. If it is Numeric or whole value so make little changes in earlier posted Calculated Column:
Calculated Column = SWITCH(Table1[Column X],
AND([Column X]>=0,[Column X]<30),"0-30",
AND([Column X]>=31,[Column X]<60),"31-60",
AND([Column X]>=61,[Column X]<90),"61-90",
AND([Column X]>=91,[Column X]<120),"91-120")
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful!
I thought earlier your Column X is Text value. If it is Numeric or whole value so make little changes in earlier posted Calculated Column:
Calculated Column = SWITCH(Table1[Column X],
AND([Column X]>=0,[Column X]<30),"0-30",
AND([Column X]>=31,[Column X]<60),"31-60",
AND([Column X]>=61,[Column X]<90),"61-90",
AND([Column X]>=91,[Column X]<120),"91-120")
Don't forget to hit Thumbs up and accept this as a solution if you find it helpful!
Hi Tahreem,
Thank you for your answer! I tried it but it says this "Function 'SWITCH' does not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values."
I was thinking if is possible using something like Formula = If([Age] => 0 but < 30, "0-30"........ and so on!
Do you thik that's possible?
Thanks a lot!!
Hi,
@manuelfigueira
Switch is used to combine multiple IFs in one neat formula:
Column = SWITCH(TRUE(),
[Value]>= 0 && [Value]<=30,"0-30",
[Value]>=31 && [Value]<=60,"31-60",
[Value]>=61 && [Value]<=90,"61-90",
[Value]>=91 && [Value]<=120,"91-120"
)
Paul
Best
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly, Kudos is nice too.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |