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
Anonymous
Not applicable

Add Columns

Hi Community,

 

I am new to power bi and i am facing below issue, Please help me figure out.

 

I have 2 data sets One data set have 3 coulmn and 2nd data set have 5 columns. I want to compare both the data sets and if the record matches then copy the values from 2nd data set to 1st data set.

 

Dataset-1

Emp id, emp name, emp address

1            vamsi          Hyd
2            Kiram           Bengalore

Dataset-2

Emp id, emp name, emp address, emp ph, emp birthyear

1            vamsi          Hyd                9848881482  1990
2            Kiram           Bengalore     9871222124   1994
3            vamsi          bengalore       1234567889   1987

 

I need output for data set-1 should be like below, 

Output

EmpID, empName, emp address, emp ph, empbirthyear
1            vamsi          Hyd                9848881482  1990
2            Kiram           Bengalore     9871222124   1994 

 

Thanks,

Paruchuri

1 ACCEPTED SOLUTION

@Anonymous,

 

Remove duplicates first, then you may use LOOKUPVALUE Function in DAX.

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

4 REPLIES 4
parry2k
Super User
Super User

set the relationship on emp id and drop the column from respective tables in a table visual.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

I have duplicate values in both tables so i can not create relation ship. 

@Anonymous,

 

Remove duplicates first, then you may use LOOKUPVALUE Function in DAX.

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

  1. In the query editor, select Dataset 1, and navigate to "Merge Queries" on the Home tab (far right).
  2. Dataset-1 will already be selected on the top, so choose Dataset-2, and join on Emp id
  3. Make sure that Join Kind is Left Outer
  4. Click OK
  5. You now have a new column in Dataset-1 called "Dataset-2" with a table in each row.
  6. Click on the double error next to Dataset-2 to expand the tables, and choose the following fields
    1. emp ph
    2. emp birthyear
    3. And de-select the option to "use original column name as prefix"
  7. You should now have the desired table.

 

2017-11-30_16-44-44.jpg

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.