'MDX (Tableau) to DAX (Power BI) calculations
I have been using Tableau for quite some time but am getting some new experience with Power BI and the use of DAX, and am wondering how I would go about recreating this formula to DAX.
IF [Threshold] <0 and [Threshold] <[Value] then 'Below'
elseif [Threshold] <0 and [Threshold] >[Value] then 'Above'
ELSEIF [Threshold] < [Value] THEN 'Above'
ELSEIF [Threshold] > [Value] THEN "Below"
ELSEIF [Threshold] = [Value] THEN "At"
ELSE "N/A"
END
Looking forward to whoever can assist, thank you!
Solution 1:[1]
Assuming you already have a measure called Threshold and a measure called Value:
Indicator = SWITCH(
TRUE(),
[Threshold] <0 && [Threshold] <[Value], "Below",
[Threshold] <0 && [Threshold] >[Value], "Above",
[Threshold] < [Value], "Above",
[Threshold] > [Value], "Below",
[Threshold] = [Value], "At",
"N/A"
)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | GregGalloway |
