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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculate Function that sums for each row tier in a matrix

Hello,

 

I have a matrix that breaks down into 5 rows. Row 1 will break into multiple Row 2 items, Row 2 breaks down into multiple row 3 items, and so on until the fifth row. 

 

I have built a calculate function that compares two columns in the matrix and returns a 1, or a 0 as seen below: 

 
Reconciled = CALCULATEIF( (SUM( COLUMN1 ) -( SUM ( COLUMN2 )<1,1,0) )
 
My issue is the following - this calculate function is recalculated for each row level, so if I am viewing at Row 5, it will return a 1 or a 0 for each row. However, if I am viewing at row 3 it still only returns a 1 or a 0 for each row 3 item (This is not what I want), ideally I would like it to display the sum of 1's and 0's at the row 5 level. So if collapse my table to row 3 and there were 10 items in row 5 that had a value of 1, at row 3 I would want it to display 10, not 1 or 0. 
 
Note: the values in Column 1 and Column 2 will not appear in the same row in the raw data, this is why I cannot simply create a new column and add that up, SUMS of column 1 and column 2 must be compared at the Matrix row levels. 
 
Let me know if you have any questions, any help would be greatly appreciated

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create  a measure Reconciled  and then create a table with row values 0,1

 

then use the bucketing using item

refer

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Create  a measure Reconciled  and then create a table with row values 0,1

 

then use the bucketing using item

refer

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.