Forum Discussion
Multi-Conditional Lookups
Since you have robust line-by-line data, you might be able to try a measures like this:
Zone= CALCULATE('Table'[Zone], FILTER(ALL([Transaction Date]) , MAX([Transaction Date])))
Weight= CALCULATE('Table'[Weight], FILTER(ALL([Transaction Date]) , MAX([Transaction Date])))
If you drag these onto your table is should do this for each tracking number.
Sorry I just saw that it needs to not be blank as well. Try creating this measure:
Zone =
// Create Table Filtered by blanks
VAR __table1 = FILTER('Your Table',[Zone]<>Blank())
// Create a table that just holds the record we want
VAR _table2 = FILTER(_table1,max('Transaction Date/Time'))
//Get the zone
VAR _zone= calculatetable(_table2,max([Zone])
return
_zoneYou should be able to do the sasme with weight, just replace the [Zone] with [Weight] and rename _zone to _weight.
- Anonymous7 years agoNot applicable
Thanks for your reply! Two questions/comments:
1) I am getting a syntax error for 'return'. Thoughts?
2) I don't understand the max(zone) part. I am not looking for the largest zone, I am looking for the zone that corresponds to the most recent date.
- Anonymous7 years agoNot applicable
1) I am getting a syntax error for 'return'. Thoughts?
Hmm, that's interesting. Make sure I didn't something silly like leave out a paranthesis somewhere. I'm not exactly sure what would cause that. can you post a screenshot?
2) I don't understand the max(zone) part. I am not looking for the largest zone, I am looking for the zone that corresponds to the most recent date.
When we write measures, the have to be aggregated. We already narrowed the table essentially down to just one row, so there will only be one value. We just put max so that the measure will accept it.
- Anonymous7 years agoNot applicable
You were correct, there was a missing parenthesis - my fault entirely.
Here is the current error I am receiving: