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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.