Forum Discussion
rylach
6 years agoHelper II
Select max value for a group based on another column
Hi,
Lookin as the following table:
TableA:
| id | value | key |
| 1 | a | 1 |
| 1 | b | 2 |
| 1 | c | 3 |
| 2 | a | 4 |
| 2 | d | 5 |
| 2 | f | 6 |
how can I write a formula for a column in another table (related to Table A (by id)), containing TableA[value] selected as MAX(TableA[key]) for each TableA[id] group?
Another words, for rows related to TableA[id]=1 it should contain 'c' and for related to TableA[id]=2 it should containg 'f'.
Best,
Ryszard.
Looking for examples of MAXX+RELATEDTABLE I found the solution, didn't know LOOKUPVALUE accepts more than one key/value pairs:
2 Replies
- Greg_DecklerCommunity Champion
rylach - Use MAXX along with RELATEDTABLE.
- rylachHelper II
Looking for examples of MAXX+RELATEDTABLE I found the solution, didn't know LOOKUPVALUE accepts more than one key/value pairs: