Forum Discussion

kolturra's avatar
kolturra
Icon for Helper IV rankHelper IV
5 years ago
Solved

Total YTD with Custom custom calculation

Hi,

 

Can some one please help me with DAX as per the below example.

 

I am able to achieve Monthly Saving field with measure but i am not able to find solution for Total YTD Savings. Please help me.

 

StartofMonthActualCostMonthlySaving (Current Month - Pervious Month)TotalYTDSavings (Previous Month Total YTD Savings + Current Month Monthly Saving)
1-Dec-20$613,777.32  
1-Jan-21$559,677.22-$54,100.10-$54,100.10
1-Feb-21$435,217.30-$124,459.92-$178,560.02
1-Mar-21$456,089.15$20,871.85-$157,688.17
1-Apr-21$209,183.26-$246,905.89-$404,594.06
1-May-21$600,157.10$390,973.84-$13,620.22
1-Jun-21$578,247.92-$21,909.18-$35,529.40
1-Jul-21$583,206.15$4,958.23-$30,571.17
1-Aug-21$586,913.41$3,707.26-$26,863.91
1-Sep-21$582,707.32-$4,206.09-$31,070.00
1-Oct-21$584,253.33$1,546.01-$29,523.99
1-Nov-21$584,618.91$365.58-$29,158.41
1-Dec-21$583,858.48-$760.43-$29,918.84

 

MonthlySaving (Current Month - Pervious Month) - This i am able to achieve

 

Total Savings - TotalYTDSavings (Previous Month Total YTD Savings + Current Month Monthly Saving)

 

Thanks,

K Raghavender Rao

  • Hi, kolturra 

    Please check the below picture and the sample pbix file's link down below.

    all measures are in the sample pbix file.

     

     

    https://www.dropbox.com/s/nt4m640mxsywp76/kolturra.pbix?dl=0 

     

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

4 Replies

  • kolturra , expected output is not clear, You can have YTD like this using time intelligence

     

    or saving would only this month amount

     

    YTD = CALCULATE([MonthlySaving],DATESYTD('Date'[Date],"12/31"))

     

    YTD = CALCULATE([ActualCost],DATESYTD('Date'[Date],"12/31")) - CALCULATE([ActualCost],DATESYTD(dateadd('Date'[Date],-1,month) ,"12/31"))

  • Hi, kolturra 

    Please check the below picture and the sample pbix file's link down below.

    all measures are in the sample pbix file.

     

     

    https://www.dropbox.com/s/nt4m640mxsywp76/kolturra.pbix?dl=0 

     

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM