Forum Discussion

stino123's avatar
stino123
Icon for Helper II rankHelper II
4 years ago
Solved

PY YTD function is not working

Hey All,   I am trying to create last year YTD functions. the function I am trying to use is the following   Discount YTD PY = CALCULATE([Discount ex VAT],DATESYTD(DATEADD(Kalender[Date],-1,year...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  stino123 ,

    I created some data:

    Here are the steps you can follow:

    1. Create measure.

     

    Measure =
    CALCULATE(
        SUM('Table'[amount]),
    FILTER(ALL('Table'),
    'Table'[date]>=DATE(YEAR(MAX('Table'[date]))-1,1,1)&&
    'Table'[date]<=DATE(YEAR(MAX('Table'[date]))-1,MONTH(MAX('Table'[date])),DAY(MAX('Table'[date])))))

     

    2. Result:

    If I have misunderstood your meaning, please provide your desired output and your pbix without privacy information.

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly