Forum Discussion
basrooz
Advocate I
4 years agoPull one value from other table based on date range
Hi, I have two tables. One table contains a user ID, a date, and a cost per order. The date is this table is showing as of when the cost per order should be applied. For instance for user A, the va...
- 4 years ago
basrooz , Try a new column like
new column =
var _max = maxx(filter(User, User[USer ID] = Order[User ID] && User[Date] <= Order[Order Date]),User[Date])
return
maxx(filter(User, User[USer ID] = Order[User ID] && User[Date] =_max),User[Cost per order])
amitchandak
Super User
4 years agobasrooz , Try a new column like
new column =
var _max = maxx(filter(User, User[USer ID] = Order[User ID] && User[Date] <= Order[Order Date]),User[Date])
return
maxx(filter(User, User[USer ID] = Order[User ID] && User[Date] =_max),User[Cost per order])