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
EaglesTony
Post Prodigy
Post Prodigy

How can I get text and value in a stacked bar chart ?

Hi,

 

  I have a stacked bar chart and on the X-axis I have a column "TotalCountDone", which I show the Maximize value.

 

  This is working and showing the number 32.

 

  What I want to do is to show this in the bar chart as "32(Done)", how can I combine Text to the number and display it like this ?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @EaglesTony 

 

Try creating a measure to dynamically generate data labels like this:

 

Detail = 
VAR DoneValue = SUMX(FILTER('DataTable', 'DataTable'[SubCategory] = "Done"), 'DataTable'[Values])
VAR BacklogValue = SUMX(FILTER('DataTable', 'DataTable'[SubCategory] = "Backlog"), 'DataTable'[Values])
RETURN 
IF(
    HASONEVALUE('DataTable'[SubCategory]),
    SWITCH(
        VALUES('DataTable'[SubCategory]),
        "Done", DoneValue & " (Done)",
        "Backlog", BacklogValue & " (Backlog)"
    ),
    BLANK()
)

 

vxianjtanmsft_0-1726643013578.png

 

Best Regards,
Jarvis Tang
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

14 REPLIES 14
Anonymous
Not applicable

Hi @EaglesTony 

 

Try creating a measure to dynamically generate data labels like this:

 

Detail = 
VAR DoneValue = SUMX(FILTER('DataTable', 'DataTable'[SubCategory] = "Done"), 'DataTable'[Values])
VAR BacklogValue = SUMX(FILTER('DataTable', 'DataTable'[SubCategory] = "Backlog"), 'DataTable'[Values])
RETURN 
IF(
    HASONEVALUE('DataTable'[SubCategory]),
    SWITCH(
        VALUES('DataTable'[SubCategory]),
        "Done", DoneValue & " (Done)",
        "Backlog", BacklogValue & " (Backlog)"
    ),
    BLANK()
)

 

vxianjtanmsft_0-1726643013578.png

 

Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thanks this worked!

 

EaglesTony
Post Prodigy
Post Prodigy

What I need is to display within the bar 3(Done). I think I had this before, but not sure how it changed.

suparnababu8
Super User
Super User

Hi @EaglesTony 

 

Create a calculated column with below DAX

CombinedText = FORMAT(MAX('Table'[TotalCountDone]), "0") & "(Done)"

The use this in x-axis of your bar chart. Then it'll display 32(Done)

 

Hope this helps

 

Thanks!

I put it on the X-axis, but it is just showing me the number, as the option to display it has Count.

 

Here is what I have:

 

EaglesTony_0-1726496923758.png

 

Kaviraj11
Super User
Super User

Can you update your Power BI version to the latest version? 




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

Proud to be a Super User!





Sure.

 

I have a column called "TotalDone", so I would create a measure as follows ?

 

TotalDoneDisplay = [field from table with the actual number] + "(Done)" ?

You could do this - CONCATENATE(SUM('Table'[ColumnName]),"(Done)")



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

Proud to be a Super User!





I was able to use:

DoneDisplay = CONVERT(FeaturesWithTheirIssues[TotChildCountDone],STRING) & "(Done)"
 
However, My bar is now showing inside
 
32 32(Done)
 
How can I get rid of the first 32 displaying as I just want
32(Done)
 
I have multiple statuses as well not just Done, so I am thinking I need to do the same thing for the other ones ?

Turn off the value section

Kaviraj11_0-1726150328366.png

 

Yes, you will need to create a condition, you can use SWITCH function.

 




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

Proud to be a Super User!





I need to show Backlog and Done, the following in Red is the Backlog(even though it shows Done", the purple is the actual Done.

 

EaglesTony_0-1726150837280.png

What I need is to show both of these in that bar as such:

Red would be "3(Backlog)" and Purple would be "32(Done)

 

 

Any ideas on this ?

Kaviraj11
Super User
Super User

Hi,

 

You can do it this way- Create a calculated column with the defintion you have and then put it in Detail sub section under data labels.

 

Kaviraj11_0-1726146371464.png

 




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

Proud to be a Super User!





I don't see that.

 

Under Data Labels I have:

 

EaglesTony_0-1726147175512.png

 

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.