Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bourne2000
Helper V
Helper V

How to calculate average cumulative?

Hi

 

I am having below table

 

bourne2000_0-1634681096822.png

 

Here the average column is a measure. Below caulcuation I did 

 

Average Max = AVERAGE(Append1[Max_Price])
Average Min = AVERAGE(Append1[Min_Price])
 Average = ([Average Max] + [Average Min]) / 2
 
Now, I want to calculate the cumulative average of average column
 
I need output as below 
 
bourne2000_2-1634681556977.png

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-N2e7mLeMaF

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

 

PBIX file attached here https://we.tl/t-0g7kEMYd7O

1 ACCEPTED SOLUTION

@bourne2000 please create a Calculated Column and call it "Average".

 

Average = ( SUM ( 'Table'[Min Price (Avg)] ) + SUM ( 'Table'[Max Price (Avg)] ) / 2

 

From here, please use the following measure:

 

Measure = TOTALYTD ( SUM ( Table[Average] ) , 'Table1'[Date] )

 

Once you have the above done, drag the measure into your Table visual and it should work.


Let me know how it all goes 🙂

 

TheoC_0-1634694893454.png

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

8 REPLIES 8
TheoC
Super User
Super User

Hi @bourne2000 

 

Create a measure as follows:

 

Measure = TOTALYTD ( SUM ( Table1[Average] ) , 'Table1'[Date] )

The output will be the cumulative average as below.

 

I've used variables in my example in the event you want to expand on the measure, etc.  However, no need to change the Measure presented above if there's no reason to expand.

 

TheoC_0-1634683046909.png

 

Hope this helps 🙂

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  Thanks

 

I am not able to get the average in the dax measure. My average column is a measure. 

 

bourne2000_0-1634687762122.png

 

It's not coming. Can you guide me?

 

 

 

 

@bourne2000 do you have a column called "Average"?  If so, you should be able to copy and paste the following:

 

Measure = TOTALYTD ( SUM ( 'Append1'[Average] ) , 'Append1'[Date] )

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC  No there is no column called "Average" . Average is a measure. That's problem I face. How to overcome ?

@bourne2000 try this:  Measure = TOTALYTD ( [Average] , 'Append1'[Date] )

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

@TheoC THANKS. I tried and getting this output. It's not taking average. Values are not correct I think

 

bourne2000_0-1634693488094.png

 

@TheoC  Seems it's not taking average. It's taking sum. 

@bourne2000 please create a Calculated Column and call it "Average".

 

Average = ( SUM ( 'Table'[Min Price (Avg)] ) + SUM ( 'Table'[Max Price (Avg)] ) / 2

 

From here, please use the following measure:

 

Measure = TOTALYTD ( SUM ( Table[Average] ) , 'Table1'[Date] )

 

Once you have the above done, drag the measure into your Table visual and it should work.


Let me know how it all goes 🙂

 

TheoC_0-1634694893454.png

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.