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
OKgo
Advocate II
Advocate II

Moving average with respect to multple variables

I would like to add a column to this table that captures moving average with multiple variables. Once imported to powerbi, the date format is automatically detected/converted.

 

Photo 1.PNG

 

In Excel I was previously using a pivot table and an AVERAGE formula pointing at the correct cells. Tips how I could elegantly do this in DAX would be appreaciated.
Photo 3.pngPhoto 2.png

1 ACCEPTED SOLUTION

Hi @OKgo,

 

Download the PowerBI desktop file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi @OKgo,

 

You may refer to my solution here.

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashishi

 

That is really impressive. I opend up the developer section within Excel and can see the VBA objects you created. I was hoping that within PowerBi I could use the 'add column' feature and have something a DAX statement in that extra column. Reason being although I personally have Excel 2013 the clients that I am working with do not.  I am deploying the data via a PowerBi web-app. Would there be a way I could convert your exceptional solution to a PowerBi 'add column' sort of solution? 

 

Thank you so much!

Hi @OKgo,

 

You are mistaken.  There is no VBA in there.  Mine's an out and out DAX solution.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Dear Ashish,


OK I don't have PowerPivot. I will work on getting a licence in the coming days.


Can you please paste the DAX code here? I am hoping to open PowerBi. Add Custom Column. Paste / edit the DAX code. And have that helper column as per your solution in my data set.

 

Thank you so much. I am really looking forward to learning DAX! I suppose I have to start somewhere.

Hi @OKgo,

 

If my reply helped, please mark it as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi @OKgo,

 

Download the PowerBI desktop file from here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
davehus
Memorable Member
Memorable Member

My understand of moving average within Powerbi is that you need a date table and from there you could use the DATESINPERIOD function to get the MA over the disired time frame. I'm not sure if it will allow it where there is just a month value in place.

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.