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
mehlenbae2
Helper II
Helper II

Stacked Bar Chart - I Can't Wrap My Head Around This

Hello,

 

I was tasked by my manager to create a stacked bar chart on my report that shows the percentages of licenses within the reported %.

 

My reported % i= 60% which we want to be the maximum value on the X-Axis of the horizontal bar chart.

Out of 60% (Reported Only %) I need to show the percentage of Licenses within that Reported %.

For some reason I cannot wrap my head around this.

 

This is as close as I've gotten: 

mehlenbae2_2-1714653763895.png

These are the correct numbers but I need them to show as a percent out of the Reported %.

 

What percentage of licenses were reported out of the Reported % (OUT OF 60%)?

 

Here is my dataset:

mehlenbae2_0-1714653227766.png

mehlenbae2_1-1714653602131.png

The Reported % for Blue and Red need to be below 60% (Reported %) as that is the total.

 

Can anyone help me with this math?

 

 

1 ACCEPTED SOLUTION

Thats a pretty specific way to view it.. 
I'm sure there's a better way but the only thing I can think of right now is 2 new measures for you.

Blue = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Reported] ), 'Table'[License] = "Blue" ),
    CALCULATE ( COUNT ( 'Table'[ID] ), ALL ( 'Table'[ID] ) )
)

Create that one then swap out blue for red to get the other measure. Once you have both created add them to your chart and you should have what you need. You wont have a field in the legend. 

View solution in original post

3 REPLIES 3
Syk
Super User
Super User

The reported % is correct for each of the colors since they are specific to each color. Blue only has 7 licenses and has used 71.4% of those. Are you saying you need to see them as a % of the total licenses?

Hi Syk,

 

Thanks for the fast response. So my boss wants the max on X-axis to be the Reported % which is 60% (6 people reported out of 10).

 

Then out of that 10 he wants to see the licenses and how the percent of each license out of 60%/Reported only %.

 

So the percentages of the legend should not exceed the reported %

 

Here is a drawing of what he is looking for (sorry its horrible):

 

mehlenbae2_0-1714655291068.png

 

Thats a pretty specific way to view it.. 
I'm sure there's a better way but the only thing I can think of right now is 2 new measures for you.

Blue = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Reported] ), 'Table'[License] = "Blue" ),
    CALCULATE ( COUNT ( 'Table'[ID] ), ALL ( 'Table'[ID] ) )
)

Create that one then swap out blue for red to get the other measure. Once you have both created add them to your chart and you should have what you need. You wont have a field in the legend. 

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.