The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
how to write a measure of average of following(coming) 8 weeks qty for the above data & I have week end date in calendar . can anyone help for solution?
Solved! Go to Solution.
Hi @Srikantht ,
I created some data:
Here are the steps you can follow:
Create measure.
Measure =
var _today=TODAY()
var _week=WEEKNUM(_today,1)
return
AVERAGEX(FILTER(ALL('Table'),'Table'[week]>=_week-8&&'Table'[week]<_week),[rand])
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Srikantht ,
I created some data:
Here are the steps you can follow:
Create measure.
Measure =
var _today=TODAY()
var _week=WEEKNUM(_today,1)
return
AVERAGEX(FILTER(ALL('Table'),'Table'[week]>=_week-8&&'Table'[week]<_week),[rand])
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you its working
Assuming that Demand Quantity is a measure, you could try
Avg 8 weeks =
VAR currentEndWeek =
LOOKUPVALUE ( 'Date'[End of week], 'Date'[Date], TODAY () )
VAR finalEndWeek = currentEndWeek + 56
RETURN
AVERAGEX (
ADDCOLUMNS (
CALCULATETABLE (
VALUES ( 'Date'[End of week] ),
'Date'[End of week] >= currentEndWeek
&& 'Date'[End of week] <= finalEndWeek
),
"@val", [Demand Quantity]
),
[@val]
)
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
21 | |
20 | |
11 | |
10 | |
7 |