Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
My objective is the following
from my 'sales' table I wish to create a column or measure which shows me the average weekly quanity of products sold based on the last 12 weeks of sales only?
my thought process was to filter the table to show only the last 12 weeks of data only.
Then to find the weekly average of goods sold I would sum the quantity and divide by 12
Is this a good route and would anyone know the DAX to achieve this??
Solved! Go to Solution.
Hi @dhallnash.
You can try to use below formula if it works on your side:
Average Of Last 12 Weeks= DIVIDE(SUMX(FILTER(ALL(Table),[DateColumn]>=LASTDATE(VALUES(Table[DateColumn]))-12*7&&[DateColumn]<=LASTDATE(VALUES(Table[DateColumn]))),[ValueColumn]),12,-1)
Notice: Table is the specify table, DateColumn is the date filed, ValueColumn is the value which your need to calculate the average.
If above not help, please prove some sample data.
Regards,
Xiaoxin Sheng
Hi @dhallnash.
You can try to use below formula if it works on your side:
Average Of Last 12 Weeks= DIVIDE(SUMX(FILTER(ALL(Table),[DateColumn]>=LASTDATE(VALUES(Table[DateColumn]))-12*7&&[DateColumn]<=LASTDATE(VALUES(Table[DateColumn]))),[ValueColumn]),12,-1)
Notice: Table is the specify table, DateColumn is the date filed, ValueColumn is the value which your need to calculate the average.
If above not help, please prove some sample data.
Regards,
Xiaoxin Sheng
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |