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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
i have two columns "Student ID" & "Status" in database, need a calculation to show colour on a card(Overall status) based on below conditions
Condition: IF all student have "Pass" status the show Green Colour
If any single student have "Fail" status the show Green colour
| Student id | Status |
| 1 | Pass |
| 2 | Fail |
| 3 | Pass |
| 4 | Pass |
| 5 | Pass |
Solved! Go to Solution.
Hi @Anonymous
Create a measure like below for overall status:-
Measure 3 = if(COUNTROWS(FILTER('Table (3)','Table (3)'[Status] = "Fail"))>0,"Fail","Pass")Now create a measure with below code and use it in conditional formatting:-
Measure =
IF (
COUNTROWS ( FILTER ( 'Table (3)', 'Table (3)'[Status] = "Fail" ) ) > 0,
"Red",
"Green"
)
Output:-
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 @Anonymous ,
Whether the advice given by @Samarth_18 has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.
Looking forward to your feedback.
Best Regards,
Henry
Hi @Anonymous
Create a measure like below for overall status:-
Measure 3 = if(COUNTROWS(FILTER('Table (3)','Table (3)'[Status] = "Fail"))>0,"Fail","Pass")Now create a measure with below code and use it in conditional formatting:-
Measure =
IF (
COUNTROWS ( FILTER ( 'Table (3)', 'Table (3)'[Status] = "Fail" ) ) > 0,
"Red",
"Green"
)
Output:-
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
@Anonymous ,
New measure =
var _color = countrows(filter(Allselected(Table), Table[Status] = "Fail"))
return
if(isblank(_color) , "Green", "Red")
Use this measure in conditional formatting using field value option
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 64 | |
| 56 | |
| 43 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 123 | |
| 108 | |
| 44 | |
| 32 | |
| 24 |