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
smithmpi
Frequent Visitor

Top 3 Conditional Formatting Bar Chart

Hi,

Here's two measures that are used to highlight the top 3 responses in the bar chart below. The measure works but it's including values outside the top 3 (highlighted in "green"). How do I fix this? Appreciate any tips please.

Top 3 Reasons For Leaving = 
VAR CurrentReason = SELECTEDVALUE('Survey Exit Data'[Q7: What is the main reason you decided to leave?])
VAR TopReasons = TOPN(3, ALL('Survey Exit Data'[Q7: What is the main reason you decided to leave?]), [Total Completions], DESC)
RETURN
IF(
    CurrentReason IN TopReasons,
    1,
    0
)
Top 3 Reasons Leaving CF = 
IF([Top 3 Reasons For Leaving] = 1, "#D5E6A5", "#54B9AD")

smithmpi_0-1707806564994.png

 

1 ACCEPTED SOLUTION

hi @smithmpi 

 

Figured the problem. If you set the color manually for any specific category and then select "All" and try to use formula, it will not override the colors you set manually. I don't know how to clear manual color selection. Try creating a new chat and don't select any colors manually.

 

talespin_0-1707888631397.png

 

View solution in original post

6 REPLIES 6
talespin
Solution Sage
Solution Sage

hi @smithmpi ,

 

There is nothing wrong with DAX. The color is coming from somewhere else. I changed the color to red/blue.

Also I created another visual and works perfectly fine with the measures you shared. I am not able to figure out the reason for problematic columns. 

 

talespin_0-1707888287528.png

 

hi @smithmpi 

 

Figured the problem. If you set the color manually for any specific category and then select "All" and try to use formula, it will not override the colors you set manually. I don't know how to clear manual color selection. Try creating a new chat and don't select any colors manually.

 

talespin_0-1707888631397.png

 

@talespin it worked after creating a new visual. At least I know it had nothing to do with the measure. Thank you so much for clarifying, appreciate it.

@smithmpi 

 

You're welcome.

talespin
Solution Sage
Solution Sage

Hi @smithmpi 

 

If possible please share pbix file will any sensitive data removed.

@talespin pbix inbox

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.