Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

LY YTD Sales - Fiscal

Hi,

 

I am having trouble calculating the YTD(fiscal year) sales for LY. I have tried several solutions found here in the community, but all of them just results in a blank result.

 

I have calculated the YTD sales for TY by using the following formula: 

 

CALCULATE([Sales 2020/21],DATESYTD('Table'[Date.Date],"06/30"))
  • Anonymous's avatar
    Anonymous
    5 years ago

    I think I might have solved it using the following formula

     

    LYYTD = CALCULATE(SUM('Sales'[Sales]),DATESBETWEEN('Sales'[Date],"1/7/2019",DATE(YEAR(NOW())-1,MONTH(NOW()),DAY(NOW()))))

4 Replies

  • Anonymous , Try like these example. I am hoping [Sales 2020/21] does not have any year filter

    it should sales , example

    YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"6/30"))
    Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"6/30"))

     

    Power BI — Year on Year with or Without Time Intelligence
    https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak 

       

      Unfortunately, the Last YTD Sales formula just gives me total of the entire fiscal year...

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak 

       

      My mistake - my description of my problem was not adequate i realize....

       

      I want the LY YTD ending today last year - if that makes sense.

       

      So I've got TY YTD (which is just the total sales. no need to make a new measure) - from 1/7/2020 until Today.

       

      Then i need LY YTD running from 1/7/2019 until Today-1year. 🙂

  • Anonymous's avatar
    Anonymous
    Not applicable

    I think I might have solved it using the following formula

     

    LYYTD = CALCULATE(SUM('Sales'[Sales]),DATESBETWEEN('Sales'[Date],"1/7/2019",DATE(YEAR(NOW())-1,MONTH(NOW()),DAY(NOW()))))