cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Shelley Member
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 v-huizhn-msft
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.

1.PNGTable12.PNGTable23.pngTable3
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])))

4.PNGresult
You can download the attachment and test.

Best Regards,
Angelia

View solution in original post

3 REPLIES 3
CahabaData New Contributor
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

 

 

 

www.CahabaData.com
Microsoft v-huizhn-msft
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.

1.PNGTable12.PNGTable23.pngTable3
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])))

4.PNGresult
You can download the attachment and test.

Best Regards,
Angelia

View solution in original post

Shelley Member
Member

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

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

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

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!

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?

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

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!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors