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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Zyg_D
Continued Contributor
Continued Contributor

How to show percentages on Stacked column chart? (not percent of grand total)

This is my data:

data.JPG

I have this graph:

graph.JPG

How do I make those numbers appear as percentages, like in the following pic?

graph2.jpg

"Percent of grand total" does not give the results that I want. 

2 ACCEPTED SOLUTIONS
v-diye-msft
Community Support
Community Support

Hi @Zyg_D 

 

kindly check below results, pbix attached.

7.PNG

 

Community Support Team _ Dina Ye
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

Zyg_D
Continued Contributor
Continued Contributor

Since it is not clear if it's possible to obtain exactly what I originally posted, I will post the workaround solution with the code for others to use. The result looks like this:

percentage_of_bar.JPG

 I have put a measure called "Percentage" into the tooltip. This is the formula:

Percentage = 
DISTINCTCOUNT ( Table1[ID] )
    / CALCULATE ( 
        DISTINCTCOUNT ( Table1[ID] ), 
        ALLEXCEPT ( Table1, Table1[Year] ) 
    )

The format had to be changed to show percentage values:

measure_tools_percentage_format.JPG

View solution in original post

7 REPLIES 7
Zyg_D
Continued Contributor
Continued Contributor

Since it is not clear if it's possible to obtain exactly what I originally posted, I will post the workaround solution with the code for others to use. The result looks like this:

percentage_of_bar.JPG

 I have put a measure called "Percentage" into the tooltip. This is the formula:

Percentage = 
DISTINCTCOUNT ( Table1[ID] )
    / CALCULATE ( 
        DISTINCTCOUNT ( Table1[ID] ), 
        ALLEXCEPT ( Table1, Table1[Year] ) 
    )

The format had to be changed to show percentage values:

measure_tools_percentage_format.JPG

v-diye-msft
Community Support
Community Support

Hi @Zyg_D 

 

kindly check below results, pbix attached.

7.PNG

 

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

Try changing the chart to one of 100% stacked bars and then placing the values as a percentage of the overall total, not the ideal aesthetic, but it's a quick and functional solution.

LuisInjante_1-1671017646611.png

Best regards

Zyg_D
Continued Contributor
Continued Contributor


@v-diye-msft wrote:

Hi @Zyg_D 

 

kindly check below results, pbix attached.

7.PNG


Thank you, Dina, for the answer. The measure that you created can at least be added to a tooltip, which would serve as a workaround.

Count and Measure by Year and Flag.JPG

Isn't it possible to show percentages while keeping bar height unaffected?

az38
Community Champion
Community Champion

Hi @Zyg_D 

set Show value as Percent of grand total in visual Value settings

 

Безымянный.png


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Zyg_D
Continued Contributor
Continued Contributor


@az38 wrote:

Hi @Zyg_D 

set Show value as Percent of grand total in visual Value settings

 

Безымянный.png


Thanks for the answer, but no. This gives me 20, 20, 20, 40. While I want 50, 50, 33.3, 66.7.

@Zyg_D I am facing the same issue as you. Have you been able to get those percentages displayed on the chart?

The only work around is using the tooltips, but sometimes clients want the % displayed on the graph.. so dissapointing that PowerBI does not have that feature... on the other hand, you are able to do it in excel...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.