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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Jayshamone
Helper I
Helper I

AVERAGE If not every dataset exists

Hello,

 

I would like to calculate an average value for our product stock.

However we do not have a value for each day, but only for each day with a change.

It would be possible, but highly memory-intensive to precalculate all non-existent values.

Is there a possibility to add the last value using DAX syntax.

 

The table below shows how it should be calculated. 

Cum_sum = 66

Avg := 66 / 7 = 9,43

 

DateValueCum_Sum
01.06.

7

7
02.06.815
03.06 23
04.06.932
05.06.1345
06.06. 58
07.06.866

 

Thank you for your ideas.

 

Justus

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Jayshamone 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ryan_mayu
Super User
Super User

@Jayshamone 

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




@ryan_mayu Thanks for the file.

However the server needs to store all of the Information.

We store 1 dataset per article (roughly 30.000) for each store (35) per day (6 months).
In order to even have a dataset for articles that haven't changed stock for a long time, we also store the last value that was longer than 6 months ago.

 

This means we would have to store an additional minimum of 189 Million - in reality more than a billion datasets on the server. 

Would it be possible to just do the calculation using DAX?

Similar methods are based on the evolution of @ryan_mayu  method. Based on what you said, using powerbi to process such a large data set is not his strong point. It is recommended that you use powerbi to visualize the data after processing the data at the data source.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.