Forum Discussion

LarsPedersen's avatar
LarsPedersen
Frequent Visitor
3 years ago
Solved

Year over Year in area chart

I'm sure this is a trivial question for the community but I haven't been able to find a good solution.   I'm looking for a way to make an area chart where accumulated sum (YTD) of produced goods is...
  • LarsPedersen's avatar
    LarsPedersen
    3 years ago

    Hi lbendlin 

     

    Thanks for your reply.

    However I did manage to resolve it myself by doing the following:

     

    Step 1. Implemented the following 3 measures: 

     

    # Calculate this Year-to-day accumulative total using TOTALYTD

    Units YTD =

    IF(

        ISBLANK([Units]), BLANK(),

        TOTALYTD([units], 'DateTable'[Date]))

     

    # Calculate sum units in the same-period-last-year

    Units LY = CALCULATE([Units], SAMEPERIODLASTYEAR(DateTable[Date]))

     

    # Calculate last year accumulative total using [Units LY] with TOTALYTD

    Units LYTD = TOTALYTD([Units LY], 'DateTable'[Date])

     

    Step 2. Extended the date table to the end of this year i.e. 2023-12-31

     

    Which yielded the following result