Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have a 2 columns which is Snapshot Hours & Charged Hours, Both columns are in the same table Report1
I want to apply coloring in such a way that, the Snapshot Hours should be red in color if it is less than 80% of Charged hours. (I want to apply this to a card in Power BI)
How do I apply that logic ?..
Solved! Go to Solution.
Hi, @akashpadmakumar
According to your description, I can clearly understand your requirement, I think you can create a measure to be used for the field formatting of the card chart like this:
This is my test data:
Color =
var _snapshot=SUM('Table'[Snapshot Hours])
var _charged=SUM('Table'[Charged Hours])*0.8
return
IF(_snapshot<_charged,"Red","Green")
Then you can click on the card chart and apply the field formatting like this:
And you can get what you want, like this:
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @akashpadmakumar
According to your description, I can clearly understand your requirement, I think you can create a measure to be used for the field formatting of the card chart like this:
This is my test data:
Color =
var _snapshot=SUM('Table'[Snapshot Hours])
var _charged=SUM('Table'[Charged Hours])*0.8
return
IF(_snapshot<_charged,"Red","Green")
Then you can click on the card chart and apply the field formatting like this:
And you can get what you want, like this:
You can download my test pbix file below
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey @akashpadmakumar ,
you can do that with another measure:
Color =
IF(
SUM( myTable[Snapshot Hours] ) < SUM( myTable[Charged hours] ) * 0.8,
"Red"
)
And this measure you can use for the conditional formatting.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
Check out the May 2024 Power BI update to learn about new features.
User | Count |
---|---|
91 | |
80 | |
61 | |
60 | |
58 |
User | Count |
---|---|
155 | |
119 | |
104 | |
78 | |
71 |