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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Powerbiuser2000
Frequent Visitor

Is it possible to display text values as a data label on clustered bar chart

I'm trying to show how long something takes in the hh:mm:ss time format on a clustered bar chart. In order for me to convert my minutes from a decimal format to the hh:mm:ss format I had to convert the value to a text string. Unfortunately now the only place Power Bi desktop is allowing my to put the text is on the tooltips but I want to show it as a data label on the bar chart. Is that even possible? Any help would be greatly appreciated.

 

Powerbiuser2000_0-1677857973533.png

 

3 REPLIES 3
ppm1
Solution Sage
Solution Sage

You likely need to use a low-code visual like Deneb to add text labels to your chart. Here is an example. In my case, I added 3 similar fields to the visual (Category, Value as a decimal, and DurationText as text).  JSON code from the visual is also provided below.

Declarative Visualization in Power BI | Deneb (deneb-viz.github.io)

ppm1_0-1677885874097.png

{
  "data": {"name": "dataset"},
  "layer": [
    {
      "mark": {
        "type": "bar",
        "tooltip": true
      }
    },
    {
      "mark": {
        "type": "text",
        "dy": 10,
        "color": "white"
      },
      "encoding": {
        "text": {
          "field": "DurationText"
        }
      }
    }
  ],
  "encoding": {
    "x": {
      "field": "Category",
      "type": "nominal"
    },
    "y": {
      "field": "Value",
      "type": "quantitative"
    }
  }
}

 

Pat

Microsoft Employee
Powerbiuser2000
Frequent Visitor

Is that available through the "Get more visuals" section of Power Bi? If so I might have just overlooked it. Do you have the name?

bsheffer
Continued Contributor
Continued Contributor

I think there is a custom bar chart visual that lets you put a custom label above the total label.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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