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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
BBlue20025
Regular Visitor

Matrix - Can Primary Row Be It's Own Calculation From Sub-Rows?

Hello. I am new to PowerBI, so I apologize if this is not explained correctly.

 

I have a matrix where there are Primary Rows each with Sub Rows similar to a Region and all the Stores that exist in that Region.

My data exists at the Store level and then I built a relationship to show which Store is in which Region.

When looking at the Store rows, I get the expected values for a % calculation. But the % for the Region is an average of the Store % values or whichever is selected.

BBlue20025_1-1777481181732.png

So as an average I get the following:

BBlue20025_0-1777479740734.png

If I go back to the original data and pivot the Store data by their Region and do the same calculation, I would not get the same value as the average.

Is there a way to get the Region's % to be its own calculation?

 

Thank you for your help.

9 REPLIES 9
danextian
Super User
Super User

Hi @BBlue20025 

You can show a different aggregation for the subtotals directly from the customize total options.

danextian_0-1777600392134.png

danextian_1-1777600408557.png

Or create a measure that iterates over a table or table expression

danextian_2-1777600566650.png

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Are you trying to select Store A or Store B in the same visual and pass that value from that row to Region calculation? If so, that isn't possible.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

I'm not sure if this helps, but in PowerBI, Region A is -17% as the average of the Store's % and I wanted it to show -15% as this calculation.

IMG_5889.jpeg

Juan-Power-bi
Resident Rockstar
Resident Rockstar

The issue is that when Power BI rolls up to the Region level, it's averaging the store percentages instead of recalculating the % from the underlying data. You want it to recalculate from scratch at every level.
The fix is to make your measure always divide the totals directly rather than aggregating the child percentages. Something like:
daxStore % =
DIVIDE(
SUM('Sales'[YourNumerator]),
SUM('Sales'[YourDenominator])
)
When this measure runs at the Region level, Power BI automatically sums all the stores in that region before dividing

I'm not too familiar with how to use dax yet.

 

In the original data, I have columns by Store and Month.

I created a column that was the average for the 3 oldest columns:

= Table.AddColumn(#"Reordered Columns", "JFM_AVG", each List.Average(List.RemoveNulls({[January], [February], [March]})))

Followed by a column to get the % comparison of the newest month compared to the AVG of the previous three months

= Table.AddColumn(#"Added Custom", "PERC", each (([April]/[JFM_AVG)-1))

And then a column to look up the Region based on the Store

LOOKUPVALUE('Region'[Region],'Region'[Store],'Store'[Store])

BBlue20025_1-1777488136043.png

How would I use the dax example? Where do I type it?

Hi,

Please share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Unfortunately I cannot share the true data.

You can share anonymised data.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I'm not sure how to modify it for that.

Does this image help explain? I currently get -17% in my Primary Row as the average of the Secondary Rows, but I want it to calculate as shown for -15%.

BBlue20025_0-1777591304605.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.