Forum Discussion

mtrussardi's avatar
mtrussardi
Frequent Visitor
5 years ago
Solved

Year to Date Function

Hi,   I have table that shows sales for 3 different years (2018,2019,2020), and I would like to compare the difference in percentage of the sales year to date . For example: Sales accumulated from ...
  • themistoklis's avatar
    5 years ago

    mtrussardi 

     

    Create 2 measures for YTD and LYTD and then calculate the percentage diff:

    YTD = CALCULATE(SUM(Table6[Amount]),DATESYTD('Calendar'[Date]))
    
    YTD LY = CALCULATE(Table6[YTD],SAMEPERIODLASTYEAR('Calendar'[Date]))

     

    Measue = ([YTD] - [YTD LY]) / [YTD LY]

     

  • themistoklis's avatar
    themistoklis
    5 years ago

    mtrussardi 

     

    It seems that the Change % is a column and not a measure.

    You should create a measure.

     

    Also the table that you are showing us contains the raw data table.

    What is the actual table that you are planning to use on the report. What fields and measures is it going to have?