Forum Discussion

bourne2000's avatar
bourne2000
Helper V
4 years ago
Solved

Calculating Average Cumulative value?

Hi

 

I am having below data

 

 

 

I want to calculate the average cumulative value . Need output as below. I did this calculation in Excel and sample excel file attached here https://we.tl/t-Y8TKJrgVYB

 

Average Cumulative of 484.50 for 30th Sep is average of all the values. For 29 sep, average cumulative is 482.86 is average of values from 23 sep to 28 sep. Same is applicable for other dates.

 

Can anyone advise me how to do this in Power BI?

 

9 Replies

  • Hi bourne2000 

     

    Try this:

     

    Average cumulative =
    CALCULATE (
        AVERAGE ( table[Value] ),
        FILTER ( ALL ( table ), table[Date] <= MAX ( table[Date] ) )
    )

     

    If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

    Appreciate your Kudos!!

     

    • bourne2000's avatar
      bourne2000
      Helper V

      VahidDM Thanks for your reply. Values are not coming correct. My value column in the table is measure. Is this something an issue?

      • VahidDM's avatar
        VahidDM
        Super User

        Can you share the DAX code of the Value measure with a sample of your data?