cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
bolabuga
Helper V
Helper V

Joining summarizes from 2 different tables.

Hello everyone,

 

I have 2 tables and both have client numbers. 

 

Table1 are much larger and is for normal clients.

Table2 have only special clients.

 

I need a third table with just the client numbers from the 2 tables, containing only distinct client numbers. Its possible have duplicities of client numbers on Table1 and Table2, because a existing normal client can be upgrade to special client anytime, or demoted from special to normal.

 

I would like to have a join of those 2 summarizes, resulting in a Table3 with distinct values of all client codes. 

Summarize ( Table1 ; Table1[client code] )

Summarize ( Table2 ; Table2[client code] )

 

 

1 ACCEPTED SOLUTION

@MFelix

 

UniqueClientID = UNION(DISTINCT(Table1[Client Code]);DISTINCT(Table2[Client Code]))

This way its still bringing a new table where i have "duplicities".

 

Distinct table1[client] = only distinct clients from table1

Distinct table2[client] = only distinct clients from table2

 

In here, considering those 2 distinct tables, they still have duplicities between them, and excuting the union is bringing more or less 30 clients with 2 ocurrences on the "uniqueclientID" table.

 

@v-yulgu-msft

 

Table 3 = SUMMARIZE(UNION( 'Table 1','Table 2'),[client code])

I dont know if im making something wrong trying to write this code, but when writing [client code], its forcing me to select the client code from the Table1. Trying to run this code is also giving me a error, i will try to translate from ptbr here, "all the arguments in the UNION table should have the same number of columns.

 

I greatful to you both, analysing the 2 suggestion helped me to understand better what i needed and helped to write something that worked.

 

Table3 = 
DISTINCT(
    UNION(
        SUMMARIZE(Table1;Table1[client code]);
        SUMMARIZE(Table2;Table2[client code])))

 

 

 

View solution in original post

3 REPLIES 3
v-yulgu-msft
Microsoft
Microsoft

Hi @bolabuga,

 

Please try this:

Table 3 = SUMMARIZE(UNION( 'Table 1','Table 2'),[client code])

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

Hi @bolabuga,

 

Create a calculate table using the following code:

 

UniqueClientID = UNION(DISTINCT(Table1[Client Code]);DISTINCT(Table2[Client Code]))

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix

 

UniqueClientID = UNION(DISTINCT(Table1[Client Code]);DISTINCT(Table2[Client Code]))

This way its still bringing a new table where i have "duplicities".

 

Distinct table1[client] = only distinct clients from table1

Distinct table2[client] = only distinct clients from table2

 

In here, considering those 2 distinct tables, they still have duplicities between them, and excuting the union is bringing more or less 30 clients with 2 ocurrences on the "uniqueclientID" table.

 

@v-yulgu-msft

 

Table 3 = SUMMARIZE(UNION( 'Table 1','Table 2'),[client code])

I dont know if im making something wrong trying to write this code, but when writing [client code], its forcing me to select the client code from the Table1. Trying to run this code is also giving me a error, i will try to translate from ptbr here, "all the arguments in the UNION table should have the same number of columns.

 

I greatful to you both, analysing the 2 suggestion helped me to understand better what i needed and helped to write something that worked.

 

Table3 = 
DISTINCT(
    UNION(
        SUMMARIZE(Table1;Table1[client code]);
        SUMMARIZE(Table2;Table2[client code])))

 

 

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors