Hi,
I'm currently trying to use TOPN as a filter context in a formula. Essentially, without going into too much detail, I'm trying to get a driver's (worker's etc.) overtime rate to be applied to his hours for the week. The driver's overtime rate for the week should be the rate on the last day of the week. In the simplified example below, that rate should be $16.
However, with a full and much larger data set, my thoughts to pull that overtime rate were something along the lines of: =CALCULATE([Overtime rate], filter by Driver, filter by week, TOPN(1,table, [Date])). With the TOPN function, I'm trying to get the formula to filter for the maximum (i.e. last) date of that week so that it can pull in that respective overtime wage.
Date Driver Overtime rate
8/31/2015 A 14
9/1/2015 A 14
9/2/2015 A 14.5
9/3/2015 A 14.5
9/4/2015 A 15
9/5/2015 A 16
Thanks!
I'm currently trying to use TOPN as a filter context in a formula. Essentially, without going into too much detail, I'm trying to get a driver's (worker's etc.) overtime rate to be applied to his hours for the week. The driver's overtime rate for the week should be the rate on the last day of the week. In the simplified example below, that rate should be $16.
However, with a full and much larger data set, my thoughts to pull that overtime rate were something along the lines of: =CALCULATE([Overtime rate], filter by Driver, filter by week, TOPN(1,table, [Date])). With the TOPN function, I'm trying to get the formula to filter for the maximum (i.e. last) date of that week so that it can pull in that respective overtime wage.
Date Driver Overtime rate
8/31/2015 A 14
9/1/2015 A 14
9/2/2015 A 14.5
9/3/2015 A 14.5
9/4/2015 A 15
9/5/2015 A 16
Thanks!