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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jennd
Employee
Employee

Match two columns and return value from 3rd column in same table

I'm trying to match two columns (Work Item ID & Parent Work Item ID) and then return the value from a 3rd column (Work Item Title).

 

I want to create 2 new columns for Parent Work Item Title and Parent Work Item Type. Where the Parent Work Item Title will come from looking up the Parent Work Item ID in the Work Item ID column and then return the Work Item Title. Likewise for Parent Work Item Type. 

 

I've tried an IF statement and LOOKUPVALUE but am not able to get it to return the right title associated with the Parent Work Item ID.

Work Item IDWork Item TitleWork Item TypeParent Work Item IDParent Work Item TitleParent Work Item Type
5920724Some titleUser Story5909913Title of parentFeature
5909913Title of parentFeature   
6180514Another titleUser Story5441103Another Parent TitleFeature
5441103Another Parent titleFeature   

 

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi  @jennd ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two calculated columns as below:

Parent Work Item Title = 
CALCULATE (
    MAX ( 'Table'[Work Item Title] ),
    FILTER ( 'Table', 'Table'[Item ID] = EARLIER ( 'Table'[Parent Work Item ID] ) )
)
Parent Work Item Type = 
CALCULATE (
    MAX ( 'Table'[Work Item Type] ),
    FILTER ( 'Table', 'Table'[Item ID] = EARLIER ( 'Table'[Parent Work Item ID] ) )
)

yingyinr_0-1657617283594.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

Hi  @jennd ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create two calculated columns as below:

Parent Work Item Title = 
CALCULATE (
    MAX ( 'Table'[Work Item Title] ),
    FILTER ( 'Table', 'Table'[Item ID] = EARLIER ( 'Table'[Parent Work Item ID] ) )
)
Parent Work Item Type = 
CALCULATE (
    MAX ( 'Table'[Work Item Type] ),
    FILTER ( 'Table', 'Table'[Item ID] = EARLIER ( 'Table'[Parent Work Item ID] ) )
)

yingyinr_0-1657617283594.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That worked! Thank you so much!

Anonymous
Not applicable

Did you try if(Work Item ID = Parent Work Item, Work Item Title, "No Match")

I did do that and it doesn't return any values when I know they exist.

Anonymous
Not applicable

Did you make sure they're the same format? I.e. Text, whole number, etc..

Yes they are all the same format. There are duplicate values in the columns, does that make a difference? 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.