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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

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 @Anonymous ,

 

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 @Anonymous ,

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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