Forum Discussion

katemarkoska's avatar
katemarkoska
Frequent Visitor
2 years ago
Solved

Map a LocalAccount to GlobalAccountPositive or GlobalAccountNegative based on the sum of the Amount

Hi, I'm trying to do a Balance Sheet report and I need to map Local Accounts to GlobalAccounts. If the sum(Amount) for the LocalAccount of all data until the selected period is >=0 then map it to G...
  • katemarkoska's avatar
    katemarkoska
    2 years ago

    Hi Anonymous 
    Thanks, but this is almost the same code as mine and I still get the circular dependence error even with this code.
    I have switched the datekey column from my Date table with the PostingDate from GenLedgEntries and it seems to work. Although it needs to be tested.

     

    MappedGlobal = 
    VAR TotalAmount=
    CALCULATE(SUM('GenLedgEntries'[Amount])/1000,
    FILTER(ALL('GenLedgEntries'),'GenLedgEntries'[PostingDate]<=MAX('GenLedgEntries'[PostingDate])))
    RETURN
    IF(
    TotalAmount>=0, 
    'GenLedgEntries'[GlobalAccountPositive],
    'GenLedgEntries'[GlobalAccountNegative]
    )