Forum Discussion
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")) )
))
Hi lync0056,
I found a same issue here: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4e3308e8-4b91-494f-80db-c95889ad4ace/filter-with-2nd-condition?forum=sqlkjpowerpivotforexcel.
Does it work for you? If not, please share us some sample data and its corresponding desired result. It will help us more to understand your requirement and give a proper solution.
Thanks,
Xi Jin.
1 Reply
- v-xjiin-msft
Solution Sage
Hi lync0056,
I found a same issue here: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4e3308e8-4b91-494f-80db-c95889ad4ace/filter-with-2nd-condition?forum=sqlkjpowerpivotforexcel.
Does it work for you? If not, please share us some sample data and its corresponding desired result. It will help us more to understand your requirement and give a proper solution.
Thanks,
Xi Jin.