Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Customer | Category | Month (Real) | Sales |
x | Baby Care | 2021M06 | 3,8542 |
x | Personal Care | 2020M11 | 18,3093 |
y | Baby Care | 2020M05 | 24,1079 |
y | Feminine Care | 2020M03 | 26,9695 |
x | Baby Care | 2021M06 | 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
@Anonymous
Here's how such calculations should look like and what a good model is (yours is not):
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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |