Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
As you can see here, in the multi-row card visual, I already implemented the filter successfully. Only the corrosion rate (mm/y) and retirement year (2037) of the Equipment ID that I filtered on the right.
I want to conditionally format the background matching the retirement year. If it is below 2025, the background color will be red. However, when I try to conditionally format the background, as you can see below, I don't know what to choose since if I choose Sum, the conditional formatting value will only work on the TOTAL sum of all the retirement years instead of ONLY the filtered value (2037). Can you guys help me on this? I'm quite new on Power-BI. Thank you so much.
Hi @asepyudistira ,
Rather than formatting by a rule, it is better to format by a measure in the field value option. You can change it by changing the first dropdown menu 'Format By'.
A measure similar to the below would do the trick:
Background Colour =
var year = SELECTEDVALUE(Corrosion[Year])
var colouring = SWITCH(
TRUE(),
year < 2025, "Red",
year >= 2025, "Green")
return
colouring
Thank you so much, it's a great suggestion.
I tried it, however, it didn't work as I expected.
As you can see below, I already copied your formula:
The result for this specific visual should be green since the returned value for the year is 2037. Instead, the background colour changes to red:
I guess the returned colour will always be red, somehow. In the below picture I tried to filter only equipment with retirement year 2021, and it's red, not green. (If the formula above is the reverse then the colour should be green)
Can you help me with this? Am I being stupid?
Thank you so much.
User | Count |
---|---|
140 | |
113 | |
104 | |
76 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |