I would like to find a value from the previous related row. Using a sales analogy I know how to find the date of the most recent row (previous sale) for a customer in this region as follows:
=MAXX(
FILTER('Sales',(('Sales'[Region]="North")) &&
'Sales'[CustomerID] = EARLIER(Sales'[CustomerID]))
,'Sales'[Sale Date]
)
But the problem is that I don’t know how to find a value from that row, such as if I want the productID. The problem is there are many sales on that date. If I could get to the SaleID I could use a Lookup() to get to it, but using maxx I can only return the field I am finding the max of. Any idea how to approach this? - Pete
=MAXX(
FILTER('Sales',(('Sales'[Region]="North")) &&
'Sales'[CustomerID] = EARLIER(Sales'[CustomerID]))
,'Sales'[Sale Date]
)
But the problem is that I don’t know how to find a value from that row, such as if I want the productID. The problem is there are many sales on that date. If I could get to the SaleID I could use a Lookup() to get to it, but using maxx I can only return the field I am finding the max of. Any idea how to approach this? - Pete