Forum Discussion

Lewdis_'s avatar
Lewdis_
Frequent Visitor
1 year ago
Solved

Running total and reference line

I am trying to build a running total for CY and PY for the month like the graph below. I would also like budget and forecast to be reference lines on the top.     
  • Lewdis_'s avatar
    1 year ago

    solved it with your help and added a filter for current year. Then the following measures

     

    Full year budget (one number) =
    CALCULATE(
        [Total Budget],
        DATESINPERIOD(DimDate[Date],DATE(2024,1,01),1,YEAR)
    )
     
     
    Running YTD last year =
    CALCULATE(
        [Running YTD],
        SAMEPERIODLASTYEAR(DimDate[Date])
    )
     
     
    Running YTD =
    CALCULATE(
        [Total sales],
        DATESYTD(DimDate[Date])
        )