Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

YTD not aggregating

Hello members,

 

I am working on the financials for my company and the YTD function is not aggregating the YTD just showing the values for the month.

the formulas as below:

 

Values PnL = SUM('PnL Data'[Values])

Values YTD = TOTALYTD([Values PnL] , dimDate[Date])
Where values PnL is my amounts and it works fine monthly
here is a snapshot of my report with the filters
 

As you can see my YTD is equal to my month.

If anyone can help.

 

thank you

 

 
  • Anonymous , your formula seems correct. need some data to test now.

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      yes I have my dimDate as table and slicer is coming from Date table

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        Anonymous , what is the formula for "FG & SPG Consumption"? I do not see that on the list.

  • themistoklis's avatar
    themistoklis
    Icon for Community Champion rankCommunity Champion

    Anonymous 

     

    You can also try this formula:

    YTD = CALCULATE(SUM('PnL Data'[Values]),DATESYTD(dimDate[Date]))

    • Anonymous's avatar
      Anonymous
      Not applicable

      I have tried it and still same Values.

      Let me show you my variable formula and just check the last line for the Values YTD.

      it is working on every other line but not the last line

       

       

      Actuals YTD =
      Var CurrentItem = SELECTEDVALUE('IS Template (2)'[Items (Normalized)])

      return
      SWITCH(TRUE(),
      currentItem = "Net Sales",[Net Sales YTD],
      currentItem = "Total Raw Material",[Raw Material YTD],
      currentItem = "Total inventory variation",[Inventory Variation YTD],
      currentItem = "TOTAL INDIRECT MATERIAL EXPENSES",[Indirect Material Expenses YTD],
      currentItem = "TOTAL ADDED VALUE",[Added Value YTD],
      currentItem = "TOTAL plant, Salaries & Wages",[PLANT, SALARIES & WAGES YTD],
      currentItem = "TOTAL OF DISTRIBUTION EXPENSES",[DISTRIBUTION EXPENSES YTD] ,
      currentItem = "TOTAL GENERAL MFG EXPENSES",[GENERAL MFG EXPENSES YTD],
      currentItem = "TOTAL DEPRECIATION",[DEPRECIATION YTD],
      currentItem = "TOTAL GROSS PROFIT",[Gross Profit YTD],
      currentItem = "TOTAL SELLING EXPENSES",[SELLING EXPENSES YTD],
      currentItem = "TOTAL ADMIN EXPENSES",[ADMIN EXPENSES YTD],
      currentItem = "TOTAL OTHER REVENUES & EXPENSES",[OTHER OPERATING REVENUS & EXPENSES YTD],
      currentItem = "Operating Profit",[Operating Profit YTD],
      currentItem = "TOTAL OTHER NON OPERATING",[Other Non Operating YTD] ,
      currentItem = "NET PROFIT (LOSS)",[Net Profit YTD] ,
      currentItem = "NET PROFIT %",FORMAT([Net profit %] ,"0.0%"),
      currentItem = "EBITDAAL",[EBITDAAL] ,
      CurrentItem = "EBITDAAL %",FORMAT([EBITDAAL %] ,"0.0%"),
       
      CALCULATE([Values YTD],FILTER('PnL Data','PnL Data'[Items]=CurrentItem)))