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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.