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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sidvix917
Helper I
Helper I

What is wrong with this Rolling average (3months).

I am trying to fix the below measure. It is giving the same price value and not the rolling average.

What I am getting:
sidvix917_0-1698865418747.png

 

What I desire:

sidvix917_1-1698865758623.png

 



Rolling 
average (3months) =
var Date_till_which_data_is_available = MAXX(ALL(Dates),MAX(Query1[observations.date]))
var Total_Sales_Values = CALCULATE(sum(Query1[observations.value]),USERELATIONSHIP(Query1[observations.date],Dates[Date]))
Var Last_Date = CALCULATE(MAX(Dates[Date]), FILTER(ALL(Dates), Dates[Date] <= MAX(Dates[Date]) && Total_Sales_Values<> 0))
Var sales_value = SUM(Query1[observations.value])
var Last_Non_Blank_Value = CALCULATE(sales_value,FILTER(ALL(Dates),Dates[Date] = Last_Date))
var Last_Date_with_Data = if(MIN(Dates[Date])>Date_till_which_data_is_available,BLANK(),Last_Non_Blank_Value)

return CALCULATE(AVERAGEX(VALUES(Dates[Month & Year]),Last_Date_with_Data),DATESINPERIOD(Dates[Date],MAX(Dates[Date]),-3,MONTH))
9 REPLIES 9
speedramps
Super User
Super User

Please ask your manager or a friend for help on how to write a clear problem description.
We are unpaid volunteers who are keen to help teach, but we are not here to do your job for you. 

Please take adequate time and effort to explain problems conisiely and clearly,  rather than dump all your confussing data with vague table and field names and expect us to know what you want. 🙄

 

What is it that you don't understand? I'm not expecting you to perform my job. I'm looking for assistance. I suppose you are more interested in talking than in helping. I don't require your help, but I appreciate it.

 

If you took trouble to look at my profile you will see I have received multiple awards for help.
If you search you will also see I get fantastic feedback for sharing my expert knowledge. I enjoy helping.

The problem is YOU.
You cant do your job and are too lazy to ask clear and concise questions.
You waste time being rude when you could just have easily provided the requested infomration and already got an answer.
Please try harder or ask a grown-up for help to write a clear decsription and I will be happy to help you.

speedramps_0-1699217657993.png

 

Congratulations on your success. You must be a celebrity!

 

I'm new to this group and have just recently begun asking Power BI-related queries. I wasn't disrespectful at first, but you were. Just because you're a Celebrity doesn't mean you can talk down on someone. Extremely unprofessional. So keep being the shining light that you are, and I will seek the assistance of other specialists in our community. I don't want to be associated with somebody who believes they are superior to everyone else. Just because you didn't comprehend doesn't mean that someone else with a higher IQ wouldn't, and I'm sure the REAL STARS in this community are more professional than you are.

Blah blah blah blah blah blah  ... 
you waste time and effort with a 100+ word rant insulting an award winning helperrather than put a tiny little effort into describing your technical problem.   🙄

No other members have offered to help you because your description is so vague. ☹️

If you look at the forum you will see that lots of other well described problems have been resolved whist you waste time arguing. 

The problem is YOU.
Swallow your pride, improve your description and we will be genuinely happy to help you. 👍

It's okay man, Chill! You still are a celebrity.


I am not asking for your time anymore. Move on.

speedramps
Super User
Super User

We want to help you but your description is too vaugue. Please write it again clearly.

Please DON'T copy & paste your DAX that does not work and expect us to fathom what you want to do. That would be crazy. 😀

Please just give a simple non technical functional decscription of what you want, then let us suggest the DAX. Thank you.

Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Also provide the example desired output, with a clear description of the process flow.

Remember not to share private data ... we don't want you to get into trouble. 😧

Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you.

You will get a quick response if you put time, care and effort into writing clear problem descriptions.

Vaugue descriptions can waste your time and ourtime.

Look foward to helping you when the above information is forthcoming

Hey Speed,

 

I appreciate your response and I agree.

 

Therefore I am attaching the sample pbix file of what I want to accomplish.

 

1) I have data that I pull from a third-party source (API) and load into my Power BI report. In this case, I just used an Excel workbook with the same amount of data.

 

2) When I put the original prices in the matrix table (not the measure I currently have on there) it shows me gaps in between months because there is no price recorded in that month. Therefore I would take the previous month's price and duplicate it if the month's price is not available.

3) I want to be able to calculate the 3-month rolling average including the prices that I have copied from the previous month that had a value.

 

4) I believe I have managed to do all that but receive an error  'visual has exceeded the available resources' . I don't want it to do that because it is important to show that visual. Now one issue that I read about is that my measures are using up too much memory. 


Would you be able to help me with this? Here is the link to the file:

https://go.wetransfer.com/t-kDe1NYkiDy

 

Thank you.

Does anyone need clarification? Is there a way to solve this?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors