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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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