Add calculated column with Sum of GL entries from another Table based on Account Type in existing Table

Konigsfeldt

New Member
Joined
Jun 17, 2020
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have the following table with GL Accounts, called "ALL NRG$G_L Account"
1607630227464.png


I want to add a calculated column "Sum Amount" that calculates the sum of GL Entries from one or several GL accounts in another table, depending on the value in column "Account Type" and "Totalling".

If "Account type" =
0 = Regular account --> Sum of same G_L Account No_ from Table ALL NRG$G_L Entry$VSIFT$4
1 = Header 1 -->Do nothing/insert blank
2 = Sum Account --> SUM of all "G_L Account No_" in interval “Totalling” from Table ALL NRG$G_L Entry$VSIFT$4
3 = Header 2 -->Do nothing/insert blank
4 = Sum Account --> SUM of all "G_L Account No_" in interval “Totalling” from Table ALL NRG$G_L Entry$VSIFT$4

The GL Entry table is called "ALL NRG$G_L Entry$VSIFT$4"
1607630411152.png


I'm not very familier with DAX, I tried something like this (see below, returned ERROR) but ended with giving up and posting my issue here.

= IF('ALL NRG$G_L Account'[Account Type]=3,0,
IF('ALL NRG$G_L Account'[Totaling]<>"",SUMX(FILTER('ALL NRG$G_L Entry$VSIFT$4',AND('ALL NRG$G_L Entry$VSIFT$4'[G_L Account No_]>LEFT('ALL NRG$G_L Account'[Totaling],4)*1,RIGHT('ALL NRG$G_L Account'[Totaling],4)*1)),'ALL NRG$G_L Entry$VSIFT$4'[SUM$Amount]),SUMX(FILTER('ALL NRG$G_L Entry$VSIFT$4','ALL NRG$G_L Entry$VSIFT$4'[G_L Account No_]='ALL NRG$G_L Account'[No_]),'ALL NRG$G_L Entry$VSIFT$4'[SUM$Amount])))


Could anybody help me with this? I hope I explained myself, otherwise please ask and I'll do my best to further explain.

Cheers
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,214,987
Messages
6,122,614
Members
449,090
Latest member
vivek chauhan

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top