Forum Discussion

Dannismen's avatar
Dannismen
Helper I
5 years ago
Solved

Cumulative/YTD formulas wrong

Hi everyone.    I've used this formula to calculate ytd value but somehow at March 28th, 2021 it always gave me a spike it shouldn't have.    Can someone plz help me on the formula?   https://d...
  • CNENFRNL's avatar
    5 years ago
    FYTD = 
    VAR __to = MAX( Combined[fiscal_BOW] )
    VAR __from =
        MINX(
            CALCULATETABLE(
                Combined,
                ALL( Combined[fiscal_BOW] ),
                Combined[fiscal_BOW] <= __to
            ),
            Combined[fiscal_BOW]
        )
    RETURN
        CALCULATE(
            SUM( Combined[Metric_Value] ),
            DATESBETWEEN( Combined[fiscal_BOW], __from, __to )
        )