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.
I am trying to understand why Power BI does not compute my DAX IF statement when I introduce a value range (value1 < x < value2)
When I create a column using this DAX expression, the column is created with no issues:
Solved! Go to Solution.
Hi,
Please try writing calculated column formula something like below.
DistanceFromOffice =
IF (
0 < 'HR Analytics Data'[DistanceFromHome]
&& 'HR Analytics Data'[DistanceFromHome] < 5,
"Close"
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
The product of 0<'HR Analytics Data'[DistanceFromHome] with be either TRUE or FALSE
But then you are trying to equate this with < 5 which is a number
So your equation is TRUE/FALSE(0<'HR Analytics Data'[DistanceFromHome]) < 5 hence failing
You can use && to give it a context like below as you are giving multiple conditions here
Thanks,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series
The product of 0<'HR Analytics Data'[DistanceFromHome] with be either TRUE or FALSE
But then you are trying to equate this with < 5 which is a number
So your equation is TRUE/FALSE(0<'HR Analytics Data'[DistanceFromHome]) < 5 hence failing
You can use && to give it a context like below as you are giving multiple conditions here
Thanks,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !! PL 300 Certification Series
Hi,
Please try writing calculated column formula something like below.
DistanceFromOffice =
IF (
0 < 'HR Analytics Data'[DistanceFromHome]
&& 'HR Analytics Data'[DistanceFromHome] < 5,
"Close"
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |