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 am trying to group staff's tenure into 5 main categories : Less than 1 year, Between 1 and 3 years, Between 3 and 5 years and Between 5 and 10 years. To do this, I created a new column and came up with the following DAX formula
Independent of the other replies - check out the SWITCH(TRUE()) syntax sugar that makes your nested IF statements look a bit better
SWITCH(TRUE(),Stafflist[Tenure]>10,"More than 10 yrs",Stafflist[Tenure]>5,"Between 5 and 10 yrs",Stafflist[Tenure]>3,"Between 3 and 5 yrs",Stafflist[Tenure]>1,"Between 1 and 3 yrs","Less than 1 yr")
Hi @pauline_teo ,
Please check format of Stafflist [Tenure].
Change it from text to Whole Number.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Got it. Thanks!
@pauline_teo
The message means what it says. You're comparing text value with numeric value. And because all comparisions in your DAX are similar Stafflist[Tenure]>{numeric value}, then the only place in a comparison where for a text value is Stafflist[Tenure] field. Verify the Stafflist[Tenure] column and make sure you changed it's data type to Whole number.
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 |
---|---|
41 | |
20 | |
19 | |
15 | |
15 |
User | Count |
---|---|
47 | |
28 | |
25 | |
17 | |
17 |