cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

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 came up short on being able to implement it. TIA. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Dynamic Conditional Formatting

@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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

8 REPLIES 8
Highlighted
Helper II
Helper II

Re: Dynamic Conditional Formatting

@czuniga You can actually create a measure that does this. I actually had to do the same thing based on a rolling average. Check the links below

 

https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting

 

https://www.blue-granite.com/blog/controlling-conditional-formatting-using-dax

Highlighted
Community Champion
Community Champion

Re: Dynamic Conditional Formatting

Hi @czuniga ,

 

It will be really useful to have some form of screesnhots to your query or a .pbix file.

Currently, it's hard to understand and answer your question.

 

Thanks,

Pragati



Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂
Highlighted
Super User IV
Super User IV

Re: Dynamic Conditional Formatting

@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

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Helper I
Helper I

Re: Dynamic Conditional Formatting

I feel like this is really close. What do I do with that measure in the context of needing to change the colors of the colums in this image based on the selection of the highlighted parameter? 80-20.jpg

Highlighted
Helper I
Helper I

Re: Dynamic Conditional Formatting

Hi Pragati, thanks for the response. I'm trying to conditionally format the colors of the these columns based on the selectio of the highlighted parameter. 80-20.jpg

Highlighted
Super User IV
Super User IV

Re: Dynamic Conditional Formatting

@czuniga , have created a measure or used rule. If used measure shared calculation. else share rules,



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper I
Helper I

Re: Dynamic Conditional Formatting

Worked perfectly. Thank you!

Highlighted
Super User IV
Super User IV

Re: Dynamic Conditional Formatting

@czuniga , please mark the solution that worked for you.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors