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
degnek
Frequent Visitor

Stacked Graph (Not 100% Chart) X-Axis Percentage of column

I am looking for a solution to view percentage of column total (even if it has been filtered) on a stacked bar chart tooltip. I have implemented many different solutions I have come across but to no avail. 

 

Previous solution suggested:

PercentageStories = DIVIDE( SUM('Monthly Totals'[Num Value]),
Calculate(SUM('Monthly Totals'[Num Value]), ALL('Monthly Totals'[Category])),0)


This solution for me is parsing the percentage across the entire chart instead of breaking based on x-axis categories. Is this the intention and/or is it possible to get it to break down by the x-axis values? For instance in my chart I break it down by group, and am needing to look at what percentage each group has for stories that are completed vs not. I would expect my Stories Completed to be showing 90 some percent for each JK and JR Stories Completed relative to their column.

 

Percent Issue.png

 

Example Data.png

7 REPLIES 7
VasTg
Memorable Member
Memorable Member

@degnek 

 

Try this..

 

DIVIDE(SUM('Table'[Value]),CALCULATE(SUM('Table'[Value]),ALL('Table'[Category])))
 
If helps, mark  it as a solution
Kudos are nice too.
 
 
Connect on LinkedIn
degnek
Frequent Visitor

@VasTg 

 

That solution then results in each tooltip being %100 no matter which Category you are hovering over. 

 

Try 1 Metric.pngTry 1.png

degnek
Frequent Visitor

Correction I was using the DAX of 

Trial% = DIVIDE( SUM('Monthly Totals'[Num Value]),
CALCULATE(SUM('Monthly Totals'[Num Value]),ALLSELECTED('Monthly Totals')))
 
This calculation then splits the percentage over the entire visual, but I need it broken down by column (area)
 
%byGraph.png
 
The PercentageStories that I also tried is the following, which only parses it out based on Category for the visual but it still spans both columns. 
PercentageStories = DIVIDE( SUM('Monthly Totals'[Num Value]),
CALCULATE(SUM('Monthly Totals'[Num Value]),ALL('Monthly Totals'[Area])),0)
 

HI @degnek ,

Maybe you can try to use the below formula, it will calculate the aggregate value of the current category with the total value.

PercentageStories =
DIVIDE (
    CALCULATE (
        SUM ( 'Monthly Totals'[Num Value] ),
        ALLSELECTED ( 'Monthly Totals' ),
        VALUES ( 'Monthly Totals'[Category] )
    ),
    CALCULATE (
        SUM ( 'Monthly Totals'[Num Value] ),
        ALLSELECTED ( 'Monthly Totals' )
    ),
    0
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft ,

Thanks for the suggestion but unfortunately that still provides a split percentage over the whole instead of parsing it out per column. This resulted in respective Stories Completed being the same 55% and 38%, which does not allow for the knowledge that each group got over 90 percent of their stories completed on time. 

VasTg
Memorable Member
Memorable Member

@degnek 

 

If my understanding is correct, the DAX I gave you should have worked.

 

Cap11.PNG

 

1. The Measure that shows the % for each column.

2. Expected graph...I hoved over JK and Stories Completed. It show 93.75%. 

3. Same graph in step 2 but displayed as table. Now you see the % in JK and JR add upto 100%.

4. Input data as a single table. 

 

Other than that, I see year 2020 in your graph. Where does it comes from?

 

Are you using the right syntax for DAX? 

 

If this helps, mark it as a solution.

Kudos are nice too.

 

Connect on LinkedIn
degnek
Frequent Visitor

I am not sure where my calculations are going wrong. I filter some additional categories but have tried the measure with nothing filtered and it is still resulting in each section getting 100%. 

 

Measure = DIVIDE(SUM('Monthly Totals'[Num Value]),CALCULATE(SUM('Monthly Totals'[Num Value]),ALL('Monthly Totals'[Category])))
 
Do you see somewhere where my measure is inaccurate? I also took out the year which was being pulled from an additional Date table, with no success. 
 
Thanks
 

2020-01-24 10-53-38_Start.png

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.