Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
I have bins created from my date field which gets the daily group.
Is there a way to calculate the weekly average, so for example from April 1st to April 7th it should have an average of 16.2 (excludes cells containing 0).
So for an output I am looking for it to show Week Commencing April 1st then display the average of 16.2, then Week Commencing April 8th to display 27, and so forth.
Thanks in advance
Solved! Go to Solution.
Hi @mdbuzzer ,
1.Create three calculated columns.
weeknum = WEEKNUM([Date],2)
Average = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[weeknum]))
week = WEEKDAY([Date],2)
2.Create a new table and create a relationship with main table.
Table 2 = FILTER('Table',[week]=3)
3.Create a calculated column in the new table.
Rolling average = CALCULATE(SUM('Table 2'[Average]),FILTER(ALL('Table 2'),[Date]<=EARLIER('Table 2'[Date])))
4.The result is as follows.
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mdbuzzer ,
1.Create three calculated columns.
weeknum = WEEKNUM([Date],2)
Average = CALCULATE(AVERAGE('Table'[Value]),ALLEXCEPT('Table','Table'[weeknum]))
week = WEEKDAY([Date],2)
2.Create a new table and create a relationship with main table.
Table 2 = FILTER('Table',[week]=3)
3.Create a calculated column in the new table.
Rolling average = CALCULATE(SUM('Table 2'[Average]),FILTER(ALL('Table 2'),[Date]<=EARLIER('Table 2'[Date])))
4.The result is as follows.
You can check more details from here.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Perfect! Thank you, that's exactly what I was looking for
a measure like
AverageX(filter(Table, Table[Col]>0),Table[Col])
For week wise data you can have columns like
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1
Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],2)
Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
Measures
This Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))
Last year Week= CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=(max('Date'[Week Rank]) -52)))
Last 8 weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]>=max('Date'[Week Rank])-8 && 'Date'[Week Rank]<=max('Date'[Week Rank])))
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
last two weeks = CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]<=max('Date'[Week Rank])-1
not sure i'm getting the right result.
Below are the figures for Week 14 so the average of these values should equal 25.2
But it's returning an average of 3 for Week 14
User | Count |
---|---|
83 | |
69 | |
68 | |
55 | |
49 |
User | Count |
---|---|
44 | |
41 | |
34 | |
34 | |
30 |