Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
I cant find a good solution on this in the forum.
Easy "if" function
IF row A has a value higher than 25000 then RED background
IF row B has a value higher than 40000 then RED background
Else green background
Year | 2024 | ||
Month | 1 | 2 | 3 |
A | 5009 | 26000 | 20604 |
B | 10438 | 18800 | 40507 |
How do I write this in DAX?
Solved! Go to Solution.
Hi, @Magnusnilsson
You can refer to @johnbasha33 and @Rupak_bi reply, if it does not work, you can try following method.
Measure:
Color =
VAR _value =
SELECTEDVALUE ( 'Table 3'[Value] )
VAR _category =
SELECTEDVALUE ( 'Table 3'[Category] )
VAR _result =
IF (
_value > 25000
&& _category = "A",
"RED",
IF ( _value > 40000 && _category = "B", "RED" )
)
RETURN
_result
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, @Magnusnilsson
You can refer to @johnbasha33 and @Rupak_bi reply, if it does not work, you can try following method.
Measure:
Color =
VAR _value =
SELECTEDVALUE ( 'Table 3'[Value] )
VAR _category =
SELECTEDVALUE ( 'Table 3'[Category] )
VAR _result =
IF (
_value > 25000
&& _category = "A",
"RED",
IF ( _value > 40000 && _category = "B", "RED" )
)
RETURN
_result
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi,
Create a flag variable using the if condition you mentioned then use that flag to do condiotional formatting in matrix visual.
User | Count |
---|---|
53 | |
28 | |
19 | |
18 | |
14 |
User | Count |
---|---|
92 | |
86 | |
39 | |
23 | |
22 |