Forum Discussion
kostask
4 years agoHelper II
Filling values for missing dates for many attribute combinations
Hi guys. I had the community's support for a similar problem, but the specific one seems more complicated for me to resolve. So, we have 3 attributes (Bank, CustomerNo, AccountNo), which give many ...
- 4 years ago
Hi kostask
Here is the updated solution with correct subtotals https://we.tl/t-ULVbpV6vB9FinalBalance1 = VAR CurrentDate = MAX ( 'Calendar'[Date] ) VAR IterationTable = CALCULATETABLE ( SUMMARIZE ( 'Totals', 'Totals'[Bank], 'Totals'[Company], 'Totals'[AccountNo] ), ALL ( 'Calendar' ) ) RETURN SUMX ( IterationTable, CALCULATE ( VAR CurrentValue = SUM ( 'Totals'[FinalBalance] ) VAR CurrentAcountTable = CALCULATETABLE ( 'Totals', ALL ('Calendar' ) ) VAR PreviousDatesTable = FILTER ( CurrentAcountTable, 'Totals'[Date] < CurrentDate ) VAR PreviousDate = MAXX ( PreviousDatesTable, 'Totals'[Date] ) VAR PreviousDateTable = FILTER ( PreviousDatesTable, 'Totals'[Date] = PreviousDate ) VAR PreviousValue = SUMX ( PreviousDateTable, 'Totals'[FinalBalance] ) RETURN - COALESCE ( CurrentValue, PreviousValue ) ) )
kostask
4 years agoHelper II
Hi, tamerj1 .
Really very similar and based on the same problem. The solution worked fine.
The final request came with more than one attributes. I tried to solve it by making changes at ALLEXCEPT function (added bank and customer),but didn't manage to reach the right result.
Do I miss something?
Thanks
Kostas