Forum Discussion

tsalsawinny's avatar
tsalsawinny
Frequent Visitor
6 years ago

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:

 

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:

 

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

3 Replies

  • 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.

    • tsalsawinny's avatar
      tsalsawinny
      Frequent Visitor

      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 :

       

       

      • amitchandak's avatar
        amitchandak
        Super User

        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