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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lancekam
Frequent Visitor

Horizontal Bar chart with Text Labels Above Each Bar AND conditional Formatting on Bars

I am looking for a way to have horizontal Bar charts with text above each bar but the bars have conditional formatting. I found a trick online creating a dummy placeholder variable and putting it as a second X-Axis value. Then changing the data label values of this dummy placeholder to be a switch statement that looks up the text I want.  Unfortunately, doing this removes the conditional formatting on the bars as multiple x-axis does not seem to support conditional formatting. 

Is there some trick or other chart? I want the text above the bars AND conditional formatting on the bar. I found one in the marketplace but it has a cost that I would like to avoid if I can.

 

Here is what I am wanting (I already have set up to have both positive and negative on the same side using ABS on the data but having the value display the real value then simple conditional format on the bars).

 

HorizontalBarWithLabels.png

 

5 REPLIES 5
v-saisrao-msft
Community Support
Community Support

Hi @lancekam,

Checking in to see if your issue has been resolved. let us know if you still need any assistance.

 

Thank you.

v-saisrao-msft
Community Support
Community Support

Hi @lancekam,

Have you had a chance to review the solution we shared earlier? If the issue persists, feel free to reply so we can help further.

 

Thank you.

danextian
Super User
Super User

Hi @lancekam 

This can be done, but in a very roundabout way. For a closer result, use the HTML visual. The left bar chart uses the native bar chart, while the right one is created with HTML, courtesy of AI after several prompts.

danextian_0-1755075589728.png

Please see the attached pbix

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
v-saisrao-msft
Community Support
Community Support

Hi @lancekam,

Thank you @Ritaf1983, for your helpfull insights.

Currently, Power BI does not offer built-in functionality to display custom text above horizontal bars while also applying conditional formatting to the bars at the same time.

 

Thank you.

Ritaf1983
Super User
Super User

Hi @lancekam 

With the core Power BI visuals, it's not currently possible to combine conditional formatting on bars with text labels placed above the bars. This limitation exists because using a second axis or dummy placeholders breaks conditional formatting support.

There are two alternative approaches:

  1. Instead of formatting the bars, format the data labels using a calculated column or measure with color logic (e.g., green for positive, red for negative). This workaround is demonstrated in this video:
    https://www.youtube.com/watch?v=EiIAkJ9R7mM

  2. Use Deneb (a custom visual based on Vega-lite). It requires some coding but gives full control over bar formatting and text placement. A ready-made template is available here:
    https://kerrykolosko.com/portfolio/compact-progress-bars/

From a UX perspective, placing the label above the bar reduces readability, especially with thin bars. It breaks the visual continuity needed for effective comparison. If the goal is to show progress or deviation, consider using a bullet chart as in the attached example. It preserves alignment and provides a more accessible layout.

Ritaf1983_0-1755066596529.png

 

PBIX file based on the example is attached.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickl

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors