Forum Discussion
akurate
3 years agoNew Member
Create a column that returns a value from another row matching the key for this one
Considering this data:
| Key | Name | Flag |
| ABC1 | John | No |
| ABC1 | Mary | Yes |
| ABC1 | Tony | No |
| ABC2 | Thorm | No |
| ABC2 | Relph | Yes |
How do I add a column that returns the Name from another row with the same key where that other row has TRUE for the flag:
| Key | Name | Flag | The Flagged Name |
| ABC1 | John | No | Mary |
| ABC1 | Mary | Yes | Mary |
| ABC1 | Tony | No | Mary |
| ABC2 | Thorm | No | Relph |
| ABC2 | Relph | Yes | Relph |
Hi akurate
Please use
Flagged Name =
MAXX (
FILTER (
CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Key] ) ),
'Table'[Flag] = "Yes"
),
'Table'[Name]
)
2 Replies
- FreemanZ
Super User
you may also try like:
Column =MAXX(FILTER(TableName,TableName[Key] = EARLIER(TableName[Key])&&TableName[Flag]="Yes"),TableName[Name])