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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
omcknac
Frequent Visitor

Conditional formatting colors using dax

Using the dax below, I have created a conditional column where certain %'s turn specified colors if not meeting targets by a certain date. The dax works great but my issue is this... when I go to apply it on the visualization (matrix) it is coloring my individual lines (Level 1) the correct colors but the roll up (averages) of my object descriptions (Level 2) is summarization "First" color at random. How can I get it to apply the correct color to individual lines as well as the averaged lines that the individuals are being rolled up into. The ask is for all to be colored not just values or totals. 

DAX used: 

omcknac_2-1712265613650.png

 Average column I am having issues with: ex data set is the 3 values in the green box are individual lines and the 28% in the purple box is the average of the individual lines... the 28% should be orange based off what I am looking for. The individual lines are colored correct. 

omcknac_3-1712265647308.png

Is there something to change in the dax to fix it or some special secret I should know on how to get the roll up averages to color code the same way the individual lines color code. 

All the thanks for anyone who can help solve my problem!!! 

Olivia

 

 

 

5 REPLIES 5
Anonymous
Not applicable

Hi @omcknac ,

Thanks to @sevenhills  for the reply, please allow me to provide another insight:


Please try changing the format style to field value and put the measure you created as a field.

vkaiyuemsft_0-1712285433452.png

 

vkaiyuemsft_1-1712285433452.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Do I need to change the DAX in order to avoid the summarization option being present?

omcknac_0-1712324853209.png

Edit to reply: I changed the DAX to include MAX:

omcknac_0-1712327604550.png

omcknac_1-1712327633089.png

omcknac_2-1712327794718.png

It didn't change the roll up average turning green instead of orange.

 

 

Anonymous
Not applicable

Hi @omcknac ,

 

Please put the color status directly into the visual object and check whether the result it returns is the result you want. If the result presented in the visual object is not the result you expect, please try to modify the expression and then put it into the condition in format. More details about conditional formatting can be found in the documentation: Apply conditional table formatting in Power BI - Power BI | Microsoft Learn.
Also, if you are willing to provide a pbix file with sample data, I will be able to help you solve your problem better.

 

Best Regards,

Clara Gong

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

sevenhills
Super User
Super User

Quick check, what is the setting for your rules for background color in conditional formatting?

Is it like this?

sevenhills_0-1712266921461.png

 

Yes I have it set to values and totals, but because the summarization is there its just choosing the "first" color that appears in the line up.

omcknac_0-1712272406079.png

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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