Forum Discussion

tfr111's avatar
tfr111
Frequent Visitor
1 year ago
Solved

YTD and SUMX issue

Hi,   I'm trying to calculate the running total using the DATESYTD function. It works well on raw data (line 1+2). If I rebase the data (deducting an offset; line 3+4) I can't get the right result....
  • Power2G's avatar
    Power2G
    1 year ago

    Thanks for the feedback tfr111 

    Instead of applying SUMX on Financials, you should iterate over a pre-filtered table that ensures only the relevant rows are summed up in a running total.

     

    In-year impact rebased =
    VAR RebasedTable =
        ADDCOLUMNS(
            SUMMARIZE(Financials, 'Financials'[Date]),
            "RebasedImpact", DIVIDE([Annualized impact rebased], 12)
        )
    RETURN
        CALCULATE(
            SUMX(RebasedTable, [RebasedImpact]),
            DATESYTD('Financials'[Date].[Date])
        )

    test via this also:

    EVALUATE ADDCOLUMNS(
        SUMMARIZE(Financials, 'Financials'[Date]),
        "RebasedImpact", DIVIDE([Annualized impact rebased], 12)
    )