This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi guys,
I'm having trouble with the Matrix Row Subtotal summing incorrectly. Can you help?
Here is the dummy report.
Thanks
Solved! Go to Solution.
Hi @Stuznet ,
I am so sorry that I missed it, now I have fixed it, try to use following measure.
Measure =
VAR r3total =
SUMX (
ADDCOLUMNS (
'Month Sort',
"1", CALCULATE ( [Row1] ),
"2", CALCULATE ( [Row2] )
),
( [1] + [2] ) * ( 13 - [Month Num] )
)
RETURN
IF (
ISINSCOPE ( 'ROW'[Category] ),
SWITCH (
TRUE (),
MAX ( 'ROW'[Category] ) = "ROW1", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row1] ),
CALCULATE (
[Row1],
FILTER ( 'Data', Data[Month Num] + 1 >= MONTH ( TODAY () ) )
)
),
MAX ( 'ROW'[Category] ) = "ROW2", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row2] ),
CALCULATE (
[Row2],
FILTER ( 'Data', Data[Month Num] + 2 <= MONTH ( TODAY () ) )
)
),
MAX ( 'ROW'[Category] ) = "ROW3", IF ( ISINSCOPE ( 'Month Sort'[Month] ), CALCULATE ( [Row3] ), r3total )
),
CALCULATE ( [Row1] ) + CALCULATE ( [Row2] ) + r3total
)
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Stuznet ,
This is caused by the max funcution in your measure while the total means all the month. You can change the measure to the following.
Measure =
IF (
ISINSCOPE ( 'ROW'[Category] ),
SWITCH (
TRUE (),
MAX ( 'ROW'[Category] ) = "ROW1", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row1] ),
CALCULATE (
[Row1],
FILTER ( 'Data', Data[Month Num] + 1 >= MONTH ( TODAY () ) )
)
),
MAX ( 'ROW'[Category] ) = "ROW2", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row2] ),
CALCULATE (
[Row2],
FILTER ( 'Data', Data[Month Num] + 2 <= MONTH ( TODAY () ) )
)
),
MAX ( 'ROW'[Category] ) = "ROW3", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row3] ),
CALCULATE (
[Row1],
FILTER ( 'Data', Data[Month Num] + 1 >= MONTH ( TODAY () ) )
)
+ CALCULATE (
[Row2],
FILTER ( 'Data', Data[Month Num] + 2 <= MONTH ( TODAY () ) )
)
)
),
CALCULATE ( [Row1] ) + CALCULATE ( [Row2] )
+ CALCULATE ( [Row3] )
)We use the inscope to judge the total and calculate different value for different scope.
If it doesn't meet your requirement, kindly share your expected result to me based on your dummy report.
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Stuznet ,
I am so sorry that I missed it, now I have fixed it, try to use following measure.
Measure =
VAR r3total =
SUMX (
ADDCOLUMNS (
'Month Sort',
"1", CALCULATE ( [Row1] ),
"2", CALCULATE ( [Row2] )
),
( [1] + [2] ) * ( 13 - [Month Num] )
)
RETURN
IF (
ISINSCOPE ( 'ROW'[Category] ),
SWITCH (
TRUE (),
MAX ( 'ROW'[Category] ) = "ROW1", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row1] ),
CALCULATE (
[Row1],
FILTER ( 'Data', Data[Month Num] + 1 >= MONTH ( TODAY () ) )
)
),
MAX ( 'ROW'[Category] ) = "ROW2", IF (
ISINSCOPE ( 'Month Sort'[Month] ),
CALCULATE ( [Row2] ),
CALCULATE (
[Row2],
FILTER ( 'Data', Data[Month Num] + 2 <= MONTH ( TODAY () ) )
)
),
MAX ( 'ROW'[Category] ) = "ROW3", IF ( ISINSCOPE ( 'Month Sort'[Month] ), CALCULATE ( [Row3] ), r3total )
),
CALCULATE ( [Row1] ) + CALCULATE ( [Row2] ) + r3total
)
BTW, pbix as attached.
Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Are you using a measure?
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Proud to be a Super User!
Yes, I'm using a measure. I provided a dummy report, feel free take a look
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 21 |