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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Past 3 months average showing incorrect values

Hi 

 

I am new to Power BI and I need help with the correct measure for showing the past 3,6,9,&12 months average sales.

 

I have Customer,Product Category,Month (which I turned into the calender table) and a sales Column.

 

CustomerCategoryMonth (Real)Sales 
xBaby Care2021M063,8542
xPersonal Care2020M1118,3093
yBaby Care2020M0524,1079
yFeminine Care2020M0326,9695
xBaby Care2021M06

5,4637

 

 

My problem is that when I calculate the average,I always get the incorrect values or I get the same value for all the product categories.

 

This is the measure I used

P3M Avg Sales = CALCULATE(SUM(Query1[Sales MSU]),DATESINPERIOD(Query1[Month],LASTDATE(Query1[Month]),-3,MONTH))/3

 

 

 

1 REPLY 1
Anonymous
Not applicable

@Anonymous 

 

Here's how such calculations should look like and what a good model is (yours is not):

https://youtu.be/ACvYaXnpyCM

 

Let me also say it clearly:

 

If your model is incorrect, you can't use the time-intel functions in it, simply because you will never get correct answers. And if you by some chance will.... it'll be purely by chance and you won't be able to trust the results.

 

I hope this clarifies this subject.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.