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
bolabuga
Helper V
Helper V

[ Average of last 6 months ]

Hello everyone, needing help with metric and/or calculated column to calculate the average of the last 6 months for each client each month.

 

Theres a sample pbix file for reference.

 

https://drive.google.com/open?id=0B8Aq8DhGApJqYkpxVzdITzlMRkE

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Try adding this to your model and let me know how you get on.

 

Average of last 6 months = AVERAGEX(
					DATESINPERIOD(
						'SAMPLE'[REFER],
						LASTDATE('SAMPLE'[REFER]),
						-6,
						MONTH)
						,
					[REVENUE TOT]
					)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

2 REPLIES 2
Phil_Seamark
Employee
Employee

Try adding this to your model and let me know how you get on.

 

Average of last 6 months = AVERAGEX(
					DATESINPERIOD(
						'SAMPLE'[REFER],
						LASTDATE('SAMPLE'[REFER]),
						-6,
						MONTH)
						,
					[REVENUE TOT]
					)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

@Phil_Seamark

 

Thks phil, I tested and its working.

 

AVERAGEX.PNG

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.