Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I am trying to create a measure which gives the average of last 2 weekdays(Last 2 Mondays/ Tuesdays and so on). Sample data are given below.
I am trying to modiy this measure but dont know how CALCULATE([Sessions],DATESINPERIOD('Calendar'[Date],MAX('Calendar'[Date]),-2,DAY))
DateWeekday|Device Category|Sessions|Average of Last 2 Weekdays
17 October 2017 | Tue | desktop | 298 | |
17 October 2017 | Tue | mobile | 3,798 | |
18 October 2017 | Wed | desktop | 586 | |
18 October 2017 | Wed | mobile | 7,942 | |
19 October 2017 | Thu | desktop | 472 | |
19 October 2017 | Thu | mobile | 5,432 | |
20 October 2017 | Fri | desktop | 394 | |
20 October 2017 | Fri | mobile | 5,491 | |
21 October 2017 | Sat | desktop | 431 | |
21 October 2017 | Sat | mobile | 6,207 | |
22 October 2017 | Sun | desktop | 441 | |
22 October 2017 | Sun | mobile | 6,164 | |
23 October 2017 | Mon | desktop | 754 | |
23 October 2017 | Mon | mobile | 5,503 | |
24 October 2017 | Tue | desktop | 777 | 538 |
24 October 2017 | Tue | mobile | 5,253 | 4526 |
25 October 2017 | Wed | desktop | 645 | 615.5 |
25 October 2017 | Wed | mobile | 4,906 | 6424 |
Solved! Go to Solution.
Hi @Prats_Kul
Try this MEASURE
Measure = AVERAGEX ( TOPN ( 2, ALLEXCEPT ( TableName, TableName[Device Category], TableName[Weekday] ), CALCULATE ( VALUES ( TableName[Date] ) ), DESC ), CALCULATE ( SUM ( TableName[Sessions] ) ) )
Hi @Prats_Kul
Try this MEASURE
Measure = AVERAGEX ( TOPN ( 2, ALLEXCEPT ( TableName, TableName[Device Category], TableName[Weekday] ), CALCULATE ( VALUES ( TableName[Date] ) ), DESC ), CALCULATE ( SUM ( TableName[Sessions] ) ) )
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
86 | |
85 | |
68 | |
67 | |
63 |
User | Count |
---|---|
210 | |
118 | |
116 | |
81 | |
74 |