Forum Discussion
Multi-Conditional Lookups
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.
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:
- Anonymous7 years agoNot applicable
Oops, try changing
calculatetable(_table2,max([Zone]))
to
sumx(_table2,[Zone])
- Iamnvt7 years agoContinued Contributor
hi,
Anonymous
you can try this Measure:
Non-blank, lastdate zone = VAR _table2 = CALCULATETABLE(FILTER(Table1, Table1[date] = MAX(Table1[date])), Table1[Zone] <> BLANK()) return CALCULATE(MAX('Table1'[Zone]), _table2)here is PBI file: