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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Matrix Subtotals

Hi all,

 

I have a matrix as follows: 

 

R45_0-1704808757270.png

I am trying to achieve both column and row totals of 100%. As you can see, this works correctly for the columns but for each row it sums the values for each person e.g. total of 1422.5 % should be 100%. How can I edit this measure or is there another workaround? I use the following measure as the values:

 

% Summary Total =

VAR SettlementVal = [Total]

VAR SelectedName = MAX(Times[name])

VAR AllSettlement =

CALCULATE (

    [Total],

    FILTER(ALLSELECTED(Times), Times[name] = SelectedName)

)

VAR Result = DIVIDE(SettlementVal, AllSettlement)

RETURN

    FORMAT(Result, "0.0%")
7 REPLIES 7
Anonymous
Not applicable

Hi @Anonymous 

Did your row field and the column field are from the same table? Can you provide some sample data so that can provide more suggestion for you.

 

Best Regards!

Yolo Zhu

 

Anonymous
Not applicable

Hi @Anonymous,

 

Thanks for your response. All data is from the same table:

 

R45_0-1704887945490.png

 

 

 

Anonymous
Not applicable

Hi @Anonymous 

You can try the following measure

Measure =
SUMX ( VALUES ( Times[name] ), [% Summary Total] )

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Anonymous 

 

Produced the error SUMX can't work with values of type String.

 

I have tried two measures that produce work for either columns totalling 100 or rows:

R45_0-1704992617023.png

 

R45_1-1704992733693.png

 

Hoping to combine them to have both the column and row overall totals = 100 cheers

 

Hi @Anonymous 

 

I think the reason the SUMX() example didn't work is because [% of Total Hours] is returning a string because of FORMAT at the end of your measure.

 

Try just returning the variable Result.  You can then change the return type for the measure by selecting that measure and changing the format to percentage in the Measure Tools menu.

 

Let me know if this helps.



Proud to be a Super User!

daxformatter.com makes life EASIER!
Anonymous
Not applicable

Hi @gmsamborn,

 

I adjusted the code as follows and combined with the code given by @Anonymous but no  success:

 

% Summary Total = VAR SettlementVal = [Total] VAR SelectedName = MAX(Times[name]) VAR AllSettlement = CALCULATE ( [Total], FILTER(ALLSELECTED(Times), Times[name] = SelectedName) ) VAR Result = DIVIDE(SettlementVal, AllSettlement) RETURN Result

OK.  I just thought I'd check.

 

I'll let @Anonymous  continue with this one.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors