Forum Discussion

czuniga's avatar
czuniga
Helper III
6 years ago
Solved

Dynamic Conditional Formatting

I'm tring to add conditional colors to columns based on what's less than/greater than a dynamic parameter value. Any ideas on how to do it? Adding a column with dynamic values seemed promising, but I...
  • amitchandak's avatar
    6 years ago

    czuniga 

    You can create a dynamic color measure. In place of static values, you can replace with value from the slicer

    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"))
    

     

    Use fields option under conditional control and choose a measure like this. Refer :https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values