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

Percentage of total legend item - two tables

Hi,

I'm trying to solve an issue that's VERY similar to https://community.powerbi.com/t5/Desktop/Displaying-percentage-of-total-for-multiple-legends-in-a/td...; in fact this solution used to work for me when all the variables were in the same table, but I've had to put the example in the link's equivalent of "campus" in the legend in a separate (but linked) data table.

 

Can anyone help me out? I've been losing my mind trying to work this out! I can't just use %GT because i want to compare programmes next to each other, rather than aggregate the cohort.

 

Happy to clarify further if needed.

 

Here's my little model:

example1.PNG

 

This is what I need to happen:
ex2.PNG*each legend item/programme sums to ~100%. This works when all variables are in the same table.
 
These are the measures that worked for me when I had programme and income in the same table for the visualization above:
 

 

1 Income = (COUNTX('Full Dataset_2018-2019', [00 Gross Income]))

1 Total Incomes = CALCULATE([1 Income ], ALLEXCEPT('Full Dataset_2018-2019', 'Full Dataset_2018-2019'[Programme Code], 'Full Dataset_2018-2019'[Subject]))

1 Perc of Income Total = DIVIDE([1 Income], [1 Total Incomes],0)

 

 
But....using this same type of solution for the screenshot above of the new model results in:
ex3.PNG

 

Would be eternally grateful for some assistance!
2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @thmpsne ,


How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?

 

Best regards,

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

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @thmpsne ,

 

We can try to create a measure using following formula to meet your requirement:

 

 

 

Perc of Income Total =
DIVIDE (
    CALCULATE ( SUM ( '1 Online_2018_2019'[Income] ) ),
    CALCULATE (
        SUM ( '1 Online_2018_2019'[Income] ),
        ALLEXCEPT ( '1 Online_2018_2019', '1 Respondent'[Subject] )
    ),
    0
)

 

 

 

If it does not work, please try to set the cross filter direction between the middle table and right table to both.

 

Best regards,

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

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

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.