Forum Discussion
Calculate Last Transaction Records
- 4 years ago
apatwal , A new column and new measure
new column =
var _max = maxx(filter(table, [Customer] = earlier([Customer]) && [Product] =earlier([Product]) && [Date] < earlier([Date])), [Date])
return
maxx(filter(table, [Customer] = earlier([Customer]) && [Product] =earlier([Product]) && [Date] _max), [Margin %])
new measure =
var _max = maxx(filter(allselected(table), [Customer] = max([Customer]) && [Product] =max([Product]) && [Date] < max([Date])), [Date])
return
maxx(filter(allselected(table), [Customer] = max([Customer]) && [Product] =max([Product]) && [Date] _max), [Margin %])
Hi apatwal ,
1.Yes, I have modified my previous reply.
2. I think amitchandak 's method is the most effective ,if there is a large data, you may try to apply some filters (like set a date period by using slicer) to reduce the query.
Best Regards,
Eyelyn Qin