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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
GabrielMonteiro
Regular Visitor

Compare values from different tables

Good day!

I have the following tables:

 

a table called Local containing the columns Local[Cliente] and Local[ProductLocal] - a client can have n products

a table called Global containing the columns Global[Cliente] and Global[ProductGlobal] - a client can have n products

a table called called Clientes containing the column Clientes[Cliente] - not repeated values

 

The table Clientes creates a join between Local and Global. Product Local and Product Global have different values.

 

I want to compare Clientes[Cliente] that have a Local[ProductLocal] and Local[ProductGlobal] because the these two tables are populated in a different way. As Product Local and Product Global are different, they are not being allowed to be displayed together in a same table.

 

Expected result: (the objective is to compare, if there is another away to compare it is ok)

 

Clientes[Cliente]Local[ProductLocal]Local[ProductGlobal]
Cliente AAblank
Cliente ABblank
Cliente ACblank
Cliente Ablank2
Cliente Ablank3
Cliente Ablank4
Cliente BAblank
Cliente BBblank
Cliente CCblank
Cliente DCblank
Cliente EAblank
Cliente Eblank1
Cliente Eblank2
Cliente FAblank
Cliente FBblank
Cliente Fblank1
Cliente Fblank2
Cliente Fblank3
Cliente Gblank3
Cliente Hblank2
Cliente Hblank3
Cliente Iblank1

 

Tables:

 

Global[Cliente]Global[ProductGlobal]
Cliente E1
Cliente E2
Cliente F1
Cliente F2
Cliente F3
Cliente G3
Cliente H2
Cliente H3
Cliente I1
Cliente A2
Cliente A3
Cliente A4

 

Local[Cliente]Local[ProductLocal]
Cliente AA
Cliente AB
Cliente AC
Cliente BA
Cliente BB
Cliente CC
Cliente DC
Cliente EA
Cliente FA
Cliente FB

 

Clientes[Cliente]
Cliente A
Cliente B
Cliente C
Cliente D
Cliente E
Cliente F
Cliente G
Cliente H
Cliente I

Thanks!

 

1 ACCEPTED SOLUTION
v-eqin-msft
Community Support
Community Support

Hi @GabrielMonteiro ,

 

Create a new table:

New Table = 
var _t1= SELECTCOLUMNS('Local',"Client",[Local[Cliente]]],"ProductLocal",[Local[ProductLocal]]],"ProductGlobal",BLANK())
var _t2= SELECTCOLUMNS('Global',"Client",[Global[Cliente]]],"ProductLocal",BLANK(),"ProductGlobal",[Global[ProductGlobal]]])
return UNION(_t1,_t2)

Eyelyn9_0-1655263384413.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @GabrielMonteiro ,

 

Create a new table:

New Table = 
var _t1= SELECTCOLUMNS('Local',"Client",[Local[Cliente]]],"ProductLocal",[Local[ProductLocal]]],"ProductGlobal",BLANK())
var _t2= SELECTCOLUMNS('Global',"Client",[Global[Cliente]]],"ProductLocal",BLANK(),"ProductGlobal",[Global[ProductGlobal]]])
return UNION(_t1,_t2)

Eyelyn9_0-1655263384413.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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