Forum Discussion

ashmitp869's avatar
ashmitp869
Icon for Responsive Resident rankResponsive Resident
2 years ago
Solved

YTD not working as expected

Hi All,

 

My YTD calculation is not working. I have a Date table which is linked with TimePhasedBudget via the Date field TimePhasedPeriod.

Filter selection is : Year 2024, MonthName = May,June and Jul. Project ID - ACC999-999 and CBS = 

 

My 

YTD Current Budget =
CALCULATE(SUM(TimePhasedBudget[Cost]), DATESYTD('Date'[Date],"6/30"))
 
The YTD should only pick up dates from (Jul 2023 to June 2024).
Output 
 

 

 

  • Hi ashmitp869 

    You have selected the multiple-month in date slicers.How you want to calculate  YTD only for selection value should come or from year of staring to selection of month . can you share briefly yur requirement.

    Thanks,
    Thennarasu R

5 Replies

  • Thennarasu_R's avatar
    Thennarasu_R
    Icon for Responsive Resident rankResponsive Resident

    Hi ashmitp869 

    You have selected the multiple-month in date slicers.How you want to calculate  YTD only for selection value should come or from year of staring to selection of month . can you share briefly yur requirement.

    Thanks,
    Thennarasu R

    • ashmitp869's avatar
      ashmitp869
      Icon for Responsive Resident rankResponsive Resident

      Hi Thennarasu,

       

      My requirement is even there is multiple selection of MonthName = June , July and other selection like this.

       

       

      The YTD calulation should give SUM  from (Jul 2023 to June 2024).

       

      This isn't working 

      YTD Current Budget =
      CALCULATE(SUM(TimePhasedBudget[Cost]), DATESYTD('Date'[Date],"6/30"))
      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        I second what Thennarasu is saying.  Why are you selecting multiple months when you want to calculate YTD?

  • Can you try the below measure.. Replace the fields accordingly.

     

    Sales YTD = TOTALYTD(SUM('Orders'[Sales]), 'Orders'[Order Date].[Date])