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
Kallagan
Frequent Visitor

match 2 columns from 2 different tables

Hello

I'm new to Power BI and to the BI world in general.

 

I have to match 2 columns from 2 diffrent tables. One table contains the name of people in an organization and the other table contain the name of people who have participated to a training.

 

1 contains ~ 700 lines and the other ~ 100 lines.

 

The goal is to return true when people have attended the training. There is also a catch, some people have attended the same training 2 or 3 times.

 

When I try to merge, Power BI says that there is nothing to match between the 2 sets of data.

 

 

The sets of data looks like the folowing:

 

 

Table 1                                         Table 2

NAME                                           NAME

AA                                                 AJ

AB                                                 AJ

AC                                                 AA

AD                                                 AB

AE                                                 AB

AF                                                 AE

AG                                                AG

AH                                                AJ

AI

AJ

I've search for a while but the solution doesn't seem to work.

 

 

Thank you for your help

1 ACCEPTED SOLUTION

Hey,

 

can you please upload your pbix to onedrive or dropbox and then post the link.

 

Here is a scrrenshot from my testdata

2017-10-13_12-09-56.png

I'm using this DAX statement to create the Calculated Column: HasAttended

HasAttended = 
IF(
    ISBLANK(
        LOOKUPVALUE(trainings[Name],trainings[Name],'employees'[Name])
    )
    ,"No"
    ,"Yes"
)

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

5 REPLIES 5
v-jiascu-msft
Employee
Employee

Hi @Kallagan,

 

Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.

 

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.
TomMartens
Super User
Super User

Hey,

 

I would not merge both tables (means, after the merge there is just one table). Instead I would create a calculated column in the employees table like so

Has attended a training = 
IF(
	ISBLANK(
		LOOKUPVALUE(Training[Column1],Training[Column1],'employee'[Column1])
	)
	,"NO"
	,"YES"
)

Hopefully this what you are looking for.

 

Regards

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hello Tom

 

First of all thank you for your answer that is exactly what I was looking for. Sadly, the request only returns 4 results ("True in the calculated column) where I should have 91 "True".

 

 

The employees that has returned true don't have anything special. Am I doing something wrong ?

Hey,

 

can you please upload your pbix to onedrive or dropbox and then post the link.

 

Here is a scrrenshot from my testdata

2017-10-13_12-09-56.png

I'm using this DAX statement to create the Calculated Column: HasAttended

HasAttended = 
IF(
    ISBLANK(
        LOOKUPVALUE(trainings[Name],trainings[Name],'employees'[Name])
    )
    ,"No"
    ,"Yes"
)

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Sorry for my late answer.

 

Thank you very much for your help.

 

 

Again sorry for my late answer.

 

 

Regards

 

 

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.

Top Solution Authors