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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
alecjbeckett
Frequent Visitor

Matching values between two columns on a single table

Hi All,

 

New to powerbi and all things Dax. I have a table below

 

Customer Ticket IDTicket NameProblem IDProblem Ticket Name
1T2017.200  
2T2017.201  
3T2017.202  
4T2017.300  
5T2017.301  
6T2017.302  
7T2017.30310 
8T2017.30410 
9T2017.30510 
10T2017.100  
11T2017.1011 
12T2017.1021 
13T2017.1034 
14T2017.1044 
15T2017.1054 
16T2017.1064 
17T2017.1074 
18T2017.1084 
19T2017.1094 
20T2017.110  

 

Unfortunately our 3rd party's database has built it in this weird way so i am trying to find a way to report on a particular set of values.

 

Problem Ticket Name Column should be the formula which looks under Problem ID column and tries to see if there is a number associated. If it finds a number it then needs to see if it can find the corresponding number in Customer Ticket ID.

 

If it finds a matching number then i need it to copy the Ticket Name for that row into Problem Ticket Name column of the same row, if it cannot find a Problem ID or it is Blank it it should just leave the corresponding cell in Problem Ticket Name blank.

 

=IF(ISNA(VLOOKUP(C2,A:B,2,FALSE))=TRUE,"",VLOOKUP(C2,A:B,2,FALSE))

 

I built the query above in Excel which does the job but struggling to think how to do this in DAX. 

 

Any help would be greatly appreciated. Hope this makes sense!

 

Thanks!

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

@alecjbeckett

 

Hi,

 

You can try this formula as a calculated column.

 

Problem Ticket Name =
LOOKUPVALUE (
    Table1[Ticket Name],
    Table1[Customer Ticket ID], 'Table1'[Problem ID]
)

Matching values between two columns on a single table.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

 

Community Support Team _ Dale
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

2 REPLIES 2
v-jiascu-msft
Employee
Employee

@alecjbeckett

 

Hi,

 

You can try this formula as a calculated column.

 

Problem Ticket Name =
LOOKUPVALUE (
    Table1[Ticket Name],
    Table1[Customer Ticket ID], 'Table1'[Problem ID]
)

Matching values between two columns on a single table.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

 

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

Thanks for this!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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