The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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).
Hi @lancekam,
Checking in to see if your issue has been resolved. let us know if you still need any assistance.
Thank you.
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.
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.
Please see the attached pbix
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.
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:
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
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.
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