Forum Discussion

akurate's avatar
akurate
New Member
3 years ago
Solved

Create a column that returns a value from another row matching the key for this one

Considering this data:

 

KeyNameFlag
ABC1JohnNo
ABC1MaryYes
ABC1TonyNo
ABC2ThormNo
ABC2RelphYes

 

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:

 

KeyNameFlagThe Flagged Name
ABC1JohnNoMary
ABC1MaryYesMary
ABC1TonyNoMary
ABC2ThormNoRelph
ABC2RelphYesRelph
  • Hi akurate 

    Please use

    Flagged Name =
    MAXX (
    FILTER (
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Key] ) ),
    'Table'[Flag] = "Yes"
    ),
    'Table'[Name]
    )

2 Replies

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi akurate 

    Please use

    Flagged Name =
    MAXX (
    FILTER (
    CALCULATETABLE ( 'Table', ALLEXCEPT ( 'Table', 'Table'[Key] ) ),
    'Table'[Flag] = "Yes"
    ),
    'Table'[Name]
    )

  • you may also try like:

    Column = 
    MAXX(
        FILTER(
            TableName,
            TableName[Key] = EARLIER(TableName[Key])
                &&TableName[Flag]="Yes"
        ),
        TableName[Name]
    )