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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
giogiogio
Helper II
Helper II

Bar charts with colors based on conditional formatting

Hi community,

 

is there a way (a trick or even free custom visual) to color charts (bar, stacked bar, donut, etc.) based on color code of the categories (like the conditional formatting setting in data color based on Hex Color Code) but also working if I have a category in "legend" and not in "axis"?

Thanks!

1 ACCEPTED SOLUTION

Hi @giogiogio ,

Sorry for misunderstanding your requirement. Power BI don't support this feature currently based on my research. You can raise a new idea and add your comments there to make this feature coming sooner. 

Best Regards

Rena

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

View solution in original post

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

Hi @giogiogio ,

You can refer the method in the following video as workaround to achieve it.

Custom LEGEND for your Power BI visual

Best Regards

Rena

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

Hi Rena @v-yiruan-msft thanks for the contribution.
In reality, I am looking for something different than a custom legend like the one shown in the video.

I am looking for a way to color data in a chart according to a pre-defined way (hex code associated to data category) when the "category" is on legend. 
Like conditional formatting of data colors when the "category" is on axis.

Hi @giogiogio ,

Sorry for misunderstanding your requirement. Power BI don't support this feature currently based on my research. You can raise a new idea and add your comments there to make this feature coming sooner. 

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@giogiogio , if you have a category on legend, it will not allow conditional formatting other wise you can create a color measure that gives hex color and use that in conditional formatting

 

If not in legend

https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-num...

 

You can use hex in place of color code

Thank you @amitchandak , so the answer is that there is no way to automatically color the data (according to hex code or similar) if the categoty is in the legend, right?

@giogiogio , I think so.

@v-yiruan-msft , @v-juanli-msft , do you think there is some option to do conditional formatting if be a field on Legend ?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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