Forum Discussion

ROCKYDO12's avatar
ROCKYDO12
Helper III
4 years ago

YTD Multi-year comparison

I have a YTD calculation which is working when doing a milti year comparision. For example if I select my fiscal year range filter and compare 5 years in a chart my amunts will be filtered by YTD. I want this calcuate my YTD based on last sales date in data set and not date as of today. How can I get this formula to give me my outcome:

YTD Amount =
VAR _SOY="04/01/" & YEAR(TODAY())
VAR _DOY=DATEDIFF(_SOY,TODAY(),DAY)
VAR SPPY=
CALCULATE(sum('Table'[Amount]),FILTER('Calendar','Calendar'[Day of Fiscal Year Number]<=_DOY))
RETURN
SPPY

 

 

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    ROCKYDO12 Could you please share a sample data with the output that you are expecting it to be.

     

    Thanks,

    Mohan V.