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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
BKnecht
Helper II
Helper II

Measure for % of Subtotal in Matrix Chart

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:

PowerBI_Chart.png

 

What I have in PowerBI so far:

powerbi_2.png

 

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.

1 ACCEPTED SOLUTION

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.

 

powerbi_solution.png

View solution in original post

3 REPLIES 3
Sean
Community Champion
Community Champion

@BKnecht

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! Smiley Happy

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.

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.

 

powerbi_solution.png

Anonymous
Not applicable

@BKnecht try calculating the total per region using allexcept

 

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

 

this will be your denominator.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.