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! Request now

Reply
mahendi
Helper I
Helper I

matrix total for measure

mahendi_0-1596357109733.png

Acc_NoAmountDateName

11Saturday, June 1, 2019a
11Monday, July 1, 2019a
11Wednesday, May 1, 2019a
21Monday, July 1, 2019b
31Saturday, June 1, 2019c
31Monday, July 1, 2019c
41Wednesday, May 1, 2019d
41Saturday, June 1, 2019d
41Monday, July 1, 2019d
51Wednesday, May 1, 2019e
51Saturday, June 1, 2019e
51Monday, July 1, 2019e
61Wednesday, May 1, 2019f
61Saturday, June 1, 2019f
71Wednesday, May 1, 2019g
71Saturday, June 1, 2019g
71Monday, July 1, 2019g
81Monday, July 1, 2019h
91Wednesday, May 1, 2019i
91Saturday, June 1, 2019i
101Wednesday, May 1, 2019j

 

Measure = VAR maxDate=MAX(Sheet1[Date]) RETURN CALCULATE(SUM(Sheet1[Amount]),ALL(Sheet1[Date].[Date]),Sheet1[Date].[Date]<=maxDate,Sheet1[Acc_No]<=7)
 
Measure 2 = CALCULATE(SUM(Sheet1[Amount]),Sheet1[Acc_No]>7)
 
Measure 3 = IF(ISBLANK([Measure]),[Measure 2],[Measure])
 
The third measure is a combination of other two measures but its total only shows measure 1 total.
I need cumulative sum of some accounts and month wise sum of other accounts.
Please help suggest some solution for this.
1 ACCEPTED SOLUTION
nandic
Super User
Super User

@mahendi ,

Here is the formula:

Measure 4 = IF(HASONEVALUE(Sheet1[Acc_No]),IF(ISBLANK([Measure]),[Measure 2],[Measure]),[Measure]+[Measure 2])

It checks if row is showing total or not. If it is total then sum these measures.

matrix total.PNG

View solution in original post

2 REPLIES 2
nandic
Super User
Super User

@mahendi ,

Here is the formula:

Measure 4 = IF(HASONEVALUE(Sheet1[Acc_No]),IF(ISBLANK([Measure]),[Measure 2],[Measure]),[Measure]+[Measure 2])

It checks if row is showing total or not. If it is total then sum these measures.

matrix total.PNG

@nandic 

Thank you! I spent 4 days to try and solve this issue.

This formula solved it for me, was a huge help. 👍

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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