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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
Souheyl11
Frequent Visitor

How can I base my bar chart colors on value ranges ?

Hi

 

I'd like to build a bar chart (multiple bars) with formatting colors based on range data values, like we do in Excel. How can we do that in Power BI ? Thank you

 

dddd.png

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Souheyl11

Assume your table has two columns called "name", "value", then create a calculated column to define which data range each value belongs to.

data range = SWITCH(TRUE(),[value]<50, "<50",[value]>=50&&[value]<80,"50~80",[value]>=80,">=80")

Then add these columns to the Stacked column chart and go to "Format" pane ->"Data colors"

9.png

 

 

Best Regards

maggie

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Souheyl11

Assume your table has two columns called "name", "value", then create a calculated column to define which data range each value belongs to.

data range = SWITCH(TRUE(),[value]<50, "<50",[value]>=50&&[value]<80,"50~80",[value]>=80,">=80")

Then add these columns to the Stacked column chart and go to "Format" pane ->"Data colors"

9.png

 

 

Best Regards

maggie

Hi @v-juanli-msft

 

Thank you, it is a good workaround however I have severals value columns so I've to do it for each value column.

 

Thanks

Hi @Souheyl11

If these value columns color based on  the same data range rule, when  you add serveral value columns in the "value" field, they would automatically show the color with the legend.

 

Best Regards

Maggie

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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