Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi ,
I want to update my card color based on the total value recived .
Example : i have Total 22 students
if 22 also passed that is 100% in maths means it should be in green
if 11 passed 50 % only so it should be in orange
if only 5 pass it is less that 40 % it should show red
Thanks for your help
Hi @Ayappan ,
Has your problem been solved by @Samarth_18 's final solution, if yes, please consider accept it as the solution to help the other members find it more quickly.
Best Regards,
Community Support Team _ kalyj
HI @Ayappan ,
Create a measure like below:-
Measure =
var _total = COUNTROWS('Table')
var _passed = COUNTROWS(FILTER('Table','Table'[Result] = "PASS"))
return (_passed/_total)
Create a another measure with below code for conditional formatiing
Measure 2 =
SWITCH(TRUE(),
[Measure] = 0.5,"Orange",
[Measure] < 0.5,"Red",
[Measure] = 1,"Green")Refere below file for reference:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi Samarath,
This is wokking but can we simplify into 1 measure. Is it posible..
Becasue for other subjects also i have to do then each subject will have 2 measures
@Ayappan , Try this:-
Measure =
VAR _total =
COUNTROWS ( 'Table' )
VAR _passed =
COUNTROWS ( FILTER ( 'Table', 'Table'[Result] = "PASS" ) )
VAR result = ( _passed / _total )
RETURN
SWITCH (
TRUE (),
result = 0.5, "Orange",
result < 0.5, "Red",
result = 1, "Green"
)
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Ayappan ,
From the conditional formatting pane shown in the picture previously, you can change the number to be a percentage and specify the values.
If you want to use a single measure, then you can use the solution provided by @Samarth_18 and convert the result of measure 1 into a variable and use measure 2 after the 'return' statement.
Hope this helps.
Thank you,
Vishesh Jain
Proud to be a Super User!
In the formatting pane...
Create a measure like...
Proud to be a Super User!
Thanks for your response .
But this is based on number i need in percentage ..
Proud to be a Super User!
Hi @Ayappan
Please share sample data or sample pbix file. You can paste excel format data.
Thanks
Proud to be a Super User! | |
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 102 | |
| 79 | |
| 57 | |
| 51 | |
| 46 |