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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
phil_galvz
New Member

Remove duplicates from union and can select which column values should retain

Seeking help regarding the union functions. I wanted to remove the duplicates from Active List table with the same employee ID from Separated List table and retain the value from Separated List table.

 

Current results:

Employee IDEmployee NameStatus
101004262Jon DoeActive
101004262Jon DoeSeparated

 

Should be result:

Employee IDEmployee NameStatus
101004262Jon DoeSeparated

 

This is my code:

 

UNION(
    SELECTCOLUMNS('ACTIVE LIST',"Employee ID",'ACTIVE LIST'[ID No.],"Employee Name",'ACTIVE LIST'[Employee Name],"Status",'ACTIVE LIST'[Status]),
SELECTCOLUMNS('SEPARATED LIST',"Employee ID",'SEPARATED LIST'[ID No.],"Employee Name",'SEPARATED LIST'[Employee Name],"Status",'SEPARATED LIST'[Status]))
 
Appreciate your help.
3 REPLIES 3
v-weiyan1-msft
Community Support
Community Support

Hi @phil_galvz ,

 

If your problem is still not resolved, can you share sample data and the results you are hoping for? Show it as a screenshot or excel. Or a sample pbix after removing sensitive data. We can better understand the problem and help you.


Best Regards,
Yulia Yan

amitchandak
Super User
Super User

@phil_galvz , Try like

 

Summarize(
UNION(
SELECTCOLUMNS('ACTIVE LIST',"Employee ID",'ACTIVE LIST'[ID No.],"Employee Name",'ACTIVE LIST'[Employee Name],"Status",'ACTIVE LIST'[Status]),
SELECTCOLUMNS('SEPARATED LIST',"Employee ID",'SEPARATED LIST'[ID No.],"Employee Name",'SEPARATED LIST'[Employee Name],"Status",'SEPARATED LIST'[Status])), [Employee ID], [Employee Name], "Status", max([Status]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amit,

 

Tried your suggestions but I have errors encountered.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.