Forum Discussion

seankoh's avatar
seankoh
Frequent Visitor
8 years ago

Calculate cumulative average by month

Hi all,

 

I want to calculate the cumulative average by month based on the selected year.


As you can see, I am able to get the desired output for year 2017. However, I cannot seem to get the correct output for year 2018, as shown below:



The cumulative average for January 2018 should be 37611 but it is showing 3134.25.

This is my formula:

SL06 cumTot = TOTALYTD(SUM(SL0006[Total]),'Calendar Table'[Date])
SL06 cumAvg = [SL06 cumTot] / CALCULATE(DISTINCTCOUNT('Calendar Table'[Month]),
    DATESINPERIOD('Calendar Table'[Date], LASTDATE('Calendar Table'[Date]), -12, MONTH))


Can someone please help me on this issue?

Thanks in advance.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    seankoh,

    Could you please share sample data of SL0006 table so that we can test?

    Regards,
    Lydia