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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
JemmaD
Helper V
Helper V

Append distinct selected columns in PQ

Hi there,

 

I have four tables, all of which hold two common columns called [Mailbox] and [Business Type]

I want to append the four tables with distinct values of these two columns

I tried bringing just these two columns in and doing a table.distinct but it's not lining the mailbox up with the right business type - it seems to have brought them in independently of one another, so I ended up appending the tables completely and then keeping the two columns but this makes the table very large to load, so I want to try again doing a distinct select of the two columns but keeping them lined up with one another.

 

Help!

1 ACCEPTED SOLUTION

I suppose you need it for a dimension table. have you tried to duplicate the 4 tables. Disable the load on the duplicates. Leave just the 2 common columns. Then select Both columns and remove duplicates. Do it for all 4 duplicates same steps. Once done append them toghether. And on the appended table do again a duplicate removal on both columns.

View solution in original post

5 REPLIES 5
BIstvan
Resolver I
Resolver I

@JemmaD  Instead of PQ you can try to do it with DAX.

Try the below example.

APPENDED TABLES

VAR Table1 =DISTINCT(
SELECTCOLUMNS(
Table1,
'Table1'[Mailbox],
'Table1'[Business Type])

VAR Table2 =DISTINCT(
SELECTCOLUMNS(
Table2,
'Table2'[Mailbox],
'Table2'[Business Type])

VAR Table3 =DISTINCT(
SELECTCOLUMNS(
Table3,
'Table3'[Mailbox],
'Table3'[Business Type])

VAR Table4 =DISTINCT(
SELECTCOLUMNS(
Table4,
'Table4'[Mailbox],
'Table4'[Business Type])

RETURN
DISTINCT(UNION(Table1,Table2,Table3,Table4))




I need to do it in Power Query as dax will create circular dependency 

I suppose you need it for a dimension table. have you tried to duplicate the 4 tables. Disable the load on the duplicates. Leave just the 2 common columns. Then select Both columns and remove duplicates. Do it for all 4 duplicates same steps. Once done append them toghether. And on the appended table do again a duplicate removal on both columns.

Ah yes good shout!

@JemmaD  let a response if it worked 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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