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
aashton
Helper V
Helper V

Help with matrix sum by groups

Hello,

I have a table set-up as below:

aashton_0-1661269272236.png

 

I'd like to use a matrix to set it up similar to a pivot table:

aashton_1-1661269312687.png

 

 

I've tried different ways and can't get it to work.  I've put BDO and State in the Rows, and have created measures for totals of phase 1, 2, and 3 and put that in the values.  But for example, the total for Phase 1 is repeating the grand total, not the total by BDO by State.  This is the formula I used:  

Total Phase 1 = CALCULATE(SUM('BDO Goals'[Phase 1 Goal]), ALLEXCEPT('BDO Goals','BDO Goals'[BDO],'BDO Goals'[State])).
This should work. Not sure why it doesn't???

 

1 REPLY 1
PaulDBrown
Community Champion
Community Champion

The measure you need is a simple SUM for each Phase. The fields in the rows provide the filter context you need

Having said that, I would model your data differently.

Table 1 would include BDO, State and the Phases Unpivotted. You can then create a simple SUM for the values and set up the matrix with the phases field (from the diemnsion table- see below) as the columns for the matrix.

Table 2 would exclude the phases columns. 
Table 3, 4 and 5 would be dimension tables for Phases, BDO and State, with one-to-many relationships between the corresponding fields in Table 1 and 2.

 

However this decision very much depends on what you need to depict in the report





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.