Forum Discussion

lync0056's avatar
lync0056
Icon for Helper I rankHelper I
8 years ago
Solved

FILTER with 2nd Condition

Hi,

 

I'm trying to FILTER the Journal Lines table firstly by Account Code = "860".

 

Following, I want iterate over my filtered rows and for each row check the corresponding side of the Journal (Via Journal ID) in the same table (All rows contain a Journal ID). If that corresponding Journal ID has Account Code "680", then keep the Account Code = "860" in my filtered table, otherwise discard it.  

 

I have had a go below, but the logic is a bit out of my league and was hoping somebody could help.

 

Rounding = 

CALCULATE(
                  SUMX( 'Journal Lines', 'Journal Lines'[Net Amount]),
                  FILTER('Journal Lines', 'Journal Lines'[Account Code] = "860"  
                 && NOT ISEMPTY ( CALCULATETABLE ( 'Journal Lines',
                     FILTER('Journal Lines', 'Journal Lines'[Journal ID] = 'Journal Lines'[Journal ID] && 'Journal Lines'[Account Code] = "680")) )

))