Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
akurate
New Member

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
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @akurate 

Please use

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

View solution in original post

2 REPLIES 2
FreemanZ
Super User
Super User

you may also try like:

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

Hi @akurate 

Please use

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.