Forum Discussion

srk_powerbi's avatar
srk_powerbi
Helper II
5 years ago
Solved

custom YTD calculation help

hi, I want to calculate YTD, Previous YTD sales total calculations. But here in my date table, Fiscal year start from 01/05/2021 for year 2021 and for each year it is different. I have two columns  ...
  • v-luwang-msft's avatar
    5 years ago

    Hi srk_powerbi ,

    You could try the following measure:

    YTD = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Date]>='Table'[FiscalYearStartDate]&&'Table'[Date]<=NOW()))
    PREYTD = CALCULATE(SUM('Table'[value]),FILTER(ALL('Table'),'Table'[Date]>='Table'[PreFiscalYearStartDate]&&'Table'[Date]<=NOW()))

     

     

    Wish it is helpufl for you!

     

    Best Regards

    Lucien