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
Anonymous
Not applicable

Sum Above in a Matrix

 

I'm having some trouble with a financial statement where I have transactions on acc 1 and 2 but the budget is set only for account3 which is a summary of acc 1 and acc 2.

 

In the field marked yellow (in the measure SumTransactions) I'd need the amounts from Account1 and Account2 summarized. So basically I'd need the DAX expression to say [If Matrix column Name is Account3 then sum amounts from row Account 1 and Account 3 else Sum TransactionAmount]

 

A complicating factor perhaps is that there are no Transactions on Account 3, its only a budgeting account.

 

The data model is set up for handling data with different granularities. Transactions are daily and budget is per month.

 

See link för example pbix file

and this for example data source

 


 MatrixMatrixData modelData model

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I turned out to be no harder than

 

SumTransactions = if(SELECTEDVALUE(Accounts[Name])="Account 3 (sum of acc 1 and 2)";
CALCULATE(sum('Transaction'[Amount]);Accounts[Name]="Account 1")+
CALCULATE(sum('Transaction'[Amount]);Accounts[Name]="Account 2");
sum('Transaction'[Amount]))

Capture.PNG

View solution in original post

1 REPLY 1
Anonymous
Not applicable

I turned out to be no harder than

 

SumTransactions = if(SELECTEDVALUE(Accounts[Name])="Account 3 (sum of acc 1 and 2)";
CALCULATE(sum('Transaction'[Amount]);Accounts[Name]="Account 1")+
CALCULATE(sum('Transaction'[Amount]);Accounts[Name]="Account 2");
sum('Transaction'[Amount]))

Capture.PNG

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.