cancel
Showing results for
Did you mean:
Highlighted
Member

## Combine the Same Columns from Three Tables into One Slicer

We have three different tables, each containing a "Contract Number" column (among others). A particular unique contract number may or may not appear in all three tables, yet this is an important variable. So, I want to combine the Distinct Contract Numbers from all three tables' Contract Number columns into one table, called "Contract Slicer" and use this table for a slicer. Is there any easy way to do this? Or a different way that is easier than I'm suggesting? Thanks for any help!

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft

## Re: Combine the Same Columns from Three Tables into One Slicer

Hi @Shelley,

Yes, you can get the expected result by following steps. I reproduce your scenario using the three tables below.

Table1Table2Table3
I want to combine the Distinct Contract Number from all three tables Contract Number columns into one table. Please click the New Table under Modeling on Home page, type the formula, you will get the new table.

`NewTable = DISTINCT(UNION(SELECTCOLUMNS(Table1,"Contract Number",Table1[Contract Number]),SELECTCOLUMNS(Table2,"Contract Number",Table2[Contract Number]),SELECTCOLUMNS(Table3,"Contract Number",Table3[Contract Number])))`

result

Best Regards,
Angelia

3 REPLIES 3
New Contributor

## Re: Combine the Same Columns from Three Tables into One Slicer

If I understand your post correctly, I would suggest a multi step set up at the table level:

- create calculated table, NewTable, from Table 1 column 1

- append Table 2 column 1 to NewTable

- append Table 3 column 1 to NewTable

- create calculated table, NewTable2, from distinct of NewTable

Microsoft

## Re: Combine the Same Columns from Three Tables into One Slicer

Hi @Shelley,

Yes, you can get the expected result by following steps. I reproduce your scenario using the three tables below.

Table1Table2Table3
I want to combine the Distinct Contract Number from all three tables Contract Number columns into one table. Please click the New Table under Modeling on Home page, type the formula, you will get the new table.

`NewTable = DISTINCT(UNION(SELECTCOLUMNS(Table1,"Contract Number",Table1[Contract Number]),SELECTCOLUMNS(Table2,"Contract Number",Table2[Contract Number]),SELECTCOLUMNS(Table3,"Contract Number",Table3[Contract Number])))`

result

Best Regards,
Angelia

Member

## Re: Combine the Same Columns from Three Tables into One Slicer

Hi Angelia, Thanks so much! This appears to have worked really well.

Announcements

#### Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!