- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

# Measure for % of Subtotal in Matrix Chart

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-06-2018 09:59 AM

Hi,

Hoping someone can help me here. I'm trying to re-create the excel table below in a PBI Matrix chart. I have the # values, but am having trouble building a % measure that will give me the % of each value compared to the subtotal.

**Excel Table I'm trying to reproduce:**

**What I have in PowerBI so far:**

As you can see, the % columns just show 100% for everything.

Anyone have any ideas as to how I can get those perentages to be a % of the subtotal, labeled here as "Total"?

Any help would be greatly appreciated - thank you.

Solved! Go to Solution.

Accepted Solutions

## Re: Measure for % of Subtotal in Matrix Chart

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-06-2018 02:45 PM

I'm going to be honest - I thought because of my own capabilities that this wouldn't work, but it was PERFECT. This is what my formula looks like:

% Onboarding = DIVIDE(CALCULATE( [# Onboarding]),CALCULATE([# Onboarding],ALLSELECTED('Contract User'[Onboarding_Healthscore_Flag_Color__c])),0)

and it worked perfectly. Thanks Sean, much appreciated - you just made my day.

All Replies

## Re: Measure for % of Subtotal in Matrix Chart

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-06-2018 11:37 AM

@BKnecht try calculating the total per region using allexcept

val = calculate(sum([buyer]), allexcept(tabl1, tabl1[region])

this will be your denominator.

## Re: Measure for % of Subtotal in Matrix Chart

[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-06-2018 11:52 AM - edited 09-06-2018 12:03 PM

Give this a try...

% Measure = DIVIDE (SUM ( Table[# Outstanding] ), CALCULATE (SUM ( Table[# Outstanding] ), ALLSELECTED ( Table[Flag Color] ) ), 0 )

So if you already have a Measure for the # Outstanding just subsititute with it in the above fomula.

Or if you count # Outstanding change the SUM above to the function you are actually using.

Good Luck!

HTH!

EDIT: ALLEXCEPT would not work in a Matrix if in addition to the Rows you also have a Column field which it appears you do.

It will only give you the correct % in the Total Column at the end.

## Re: Measure for % of Subtotal in Matrix Chart

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-06-2018 02:45 PM

I'm going to be honest - I thought because of my own capabilities that this wouldn't work, but it was PERFECT. This is what my formula looks like:

% Onboarding = DIVIDE(CALCULATE( [# Onboarding]),CALCULATE([# Onboarding],ALLSELECTED('Contract User'[Onboarding_Healthscore_Flag_Color__c])),0)

and it worked perfectly. Thanks Sean, much appreciated - you just made my day.