Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

How to turn off conditional formatting once the qualifier is met

Using conditional formattin, I set a flag to highlight the Patients Name and Visit Age fields 60 days PRIOR to their 19th birthdate. 

Is there a way to turn off the rule once the birthdate passes?

In the sample picture you will see the yellow highlights patients whose birthdays are within 60-days but the green highlights are people who have already turned 19. (In my report, both categories are actually yellow). Again, the goal is to create a rule that once the date of birth passes and the patient is 19, the field color will return to the white.

anwilkins_0-1660832480685.png

Here are the 3 new columns I used to create the conditional formatting alert

 

*19th-BD = DATE ( YEAR ( MERGE_BillingSUMMARY[Patient Birthdate] ) + 19, MONTH ( MERGE_BillingSUMMARY[Patient Birthdate] ), DAY ( MERGE_BillingSUMMARY[Patient Birthdate] ) )

*19th-BD Alert = ('MERGE_BillingSUMMARY'[*19th-BD] - 60)

*19th-AlertFlag = if (Now() >= 'MERGE_BillingSUMMARY'[*19th-BD Alert],1)

 

anwilkins_1-1660833005781.png

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , you can create a measure based on you need and use that in conditional formatting using field value option

 

examples

 

olor Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) < date(2022,04,10) ,
Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .75 , "Amber" ,
"Red "
) ,
Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
)
)

 

 

Color Date =
var _min =minx(allselected(Date,Date[Year])
return
Switch( true(),
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"lightgreen",
FIRSTNONBLANK('Date'[Year],year(TODAY()))-_min =0 ,"blue",
"red")

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/1682539
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pane-66e0afcb15f3

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Sorry, I'm not an advanced user and though I appreciate the dax, could you also provide a bit of explanation as to what it all means and how the Green and Amber relate to my example? 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors