The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |