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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
tsalsawinny
Frequent Visitor

Conditional Formatting with two conditions in DATE range

Hi, im newbie in power BI.

 

Im doing some project about to change the conditional formatting to update SLA Target with the same period (e.g start from January 2020 target SLA is 98%, but the previous months still 90%). See attached picture:

SLA.PNG

 

And i already search about find two conditions in one period data, :

 

NewSLA =
MAXX(ref_sla,
IF(ref_sla[SLA%] <= DATE(2020,01,01), 1,
IF(ref_sla[SLA%] > DATE(2020,01,01),2)))
 
And after that i apply in my conditional formatting like this:
 
 

But, the result data is only to use the same color like this:

after apply.PNG

 

Can you guys help me to find the solutions? 
Thanks a lot.

3 REPLIES 3
amitchandak
Super User
Super User

Why are comparing SLA with date. Try to have a combined measure, which returns color based on date and Value

Refer

Color Date = if(FIRSTNONBLANK('Date'[date],TODAY()) <today(),"lightgreen","red")

Color sales = if(AVERAGE(Sales[Sales Amount])<170,"green","red")
Color Year = if(FIRSTNONBLANK('Date'[Year],2014) <=2016,"lightgreen",if(FIRSTNONBLANK('Date'[Year],2014)>2018,"red","yellow"))

 

In conditional formatting, Advance control, choose a field and give this measure.

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

thanks for reply.

But, im still dont understand how to place the 3 conditions measure in one field?

because the option is only one field :

 

SLA.PNG

 

In the same ui, in place of rule choose field. After that, you can use a measure in next option

 

Before that, you need to create a measure that returns colors. So use the tree measure I give as a reference how to handle parameter and measure and create a measure to return color

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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