Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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.
User | Count |
---|---|
96 | |
87 | |
78 | |
72 | |
68 |
User | Count |
---|---|
113 | |
105 | |
84 | |
65 | |
64 |