dlrosencrans
New Member
- Joined
- Apr 27, 2017
- Messages
- 4
Hoping someone has a number of ideas or a solution.
The requirement I have is to calculate a weekly average from a daily max transaction calculation for each day.
The following measures are working:
MaxTrans:=MAX(TransactionTable[Transactions])
MaxTransOnDay:=MAXX(VALUES(DimDate[Date]),[MaxTrans])
MaxTransOnCurrentWeek:=CALCULATE([MaxTrans],FILTER(All(DimDate), DimDate[WeekOfYearNumber] = MIN(DimDate[WeekOfYearNumber])))
A sample of the transaction table looks like:
<tbody>
</tbody>
The Pivot looks like: Filtering User, Week, and Day (M-F)
<tbody>
</tbody>
What I am struggling with is the MaxAvgWeek:
<tbody>
</tbody>
[FONT="]MAxAvgWeek:=CALCULATE(AVERAGEX(Transactions,[MaxTransDay]),FIL[/FONT]<wbr style="box-sizing: inherit; color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: medium;">[FONT="]TER(ALL(Transactions),Transactions[WeekNum]=MAX(D[/FONT]<wbr style="box-sizing: inherit; color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: medium;">[FONT="]ate[WeekNum])))[/FONT]
Thanks!
The requirement I have is to calculate a weekly average from a daily max transaction calculation for each day.
The following measures are working:
MaxTrans:=MAX(TransactionTable[Transactions])
MaxTransOnDay:=MAXX(VALUES(DimDate[Date]),[MaxTrans])
MaxTransOnCurrentWeek:=CALCULATE([MaxTrans],FILTER(All(DimDate), DimDate[WeekOfYearNumber] = MIN(DimDate[WeekOfYearNumber])))
A sample of the transaction table looks like:
User | DateTime | Transactions |
G1 | 4/25/2017 9:00:00 AM | 30 |
G2 | 4/25/2017 9:00:00 AM | 45 |
G1 | 4/25/2017 9:15:00 AM | 40 |
G1 | 4/25/2017 10:00:00 AM | 33 |
G2 | 4/26/2017 9:00:00 AM | 39 |
G1 | 4/26/2017 11:00:00 AM | 18 |
<tbody>
</tbody>
The Pivot looks like: Filtering User, Week, and Day (M-F)
User | Date | MaxTransOnDay | MaxTransOnWeek |
G1 | 4/25/2017 | 40 | 40 |
G1 | 4/26/2017 | 18 | 40 |
<tbody>
</tbody>
What I am struggling with is the MaxAvgWeek:
User | Date | MaxTransOnDay | MaxTransOnWeek | MaxAvgWeek |
G1 | 4/25/2017 | 40 | 40 | 29 |
G1 | 4/26/2017 | 18 | 40 | 29 |
<tbody>
</tbody>
[FONT="]MAxAvgWeek:=CALCULATE(AVERAGEX(Transactions,[MaxTransDay]),FIL[/FONT]<wbr style="box-sizing: inherit; color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: medium;">[FONT="]TER(ALL(Transactions),Transactions[WeekNum]=MAX(D[/FONT]<wbr style="box-sizing: inherit; color: rgb(0, 0, 0); font-family: "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif; font-size: medium;">[FONT="]ate[WeekNum])))[/FONT]
Thanks!