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.
The following returns the number of sales for week 1 by poduct:
COUNTX(CALCULATETABLE('SALES REPORT','SALES REPORT'[WEEK NUM]=1),[Count of Gross Sales])
1. I would like to create a calculation that shows the average of all (52) weeks
2. I would also like to reate a moving average of the last 4 weeks.
Mate, forget about creating what you want without a proper DATE TABLE. You can't do this based only on the fact table.
I'll give you a hint. Try to post a full description of the model and, if possible, also some sample data.
Best
Darek
@Anonymous, I do have a proper date table set up
You do?
Well, it does not look like that at all. Your measure
COUNTX(
CALCULATETABLE(
'SALES REPORT',
'SALES REPORT'[WEEK NUM] = 1
),
[Count of Gross Sales]
)
does not use the Date table to move back and forth in time. It uses some WEEK NUM that's stored in your fact table. Please try to understand that if you go against the rules of proper design, you're shooting yourself in the foot.
But it's your call... 🙂
Best
Darek
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
14 | |
10 |
User | Count |
---|---|
58 | |
50 | |
44 | |
19 | |
18 |