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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Morgana_2022
Helper I
Helper I

Getting distinct values for multiple tables

HI!

I have 2 tables: Table A and Table B.

tables.jpg

I have to create a new table C with the data "Competenze_Ruoli" obtained from the distinct sum (without duplicates) of the same data present in tables A and B.

How can I do?
Thank you!

8 REPLIES 8
Morgana_2022
Helper I
Helper I

Hi!
if I have to add a new column in addition to this one obtained with UNION, how do I write it?

Table C =

UNION (

VALUES ( 'Table A'[Competenze_Ruoli] ),

VALUES ( 'Table B'[Competenze_Ruoli] )

)

)

@Morgana_2022 

Table C =
DISTINCT (
UNION (
SUMMARIZE ( 'Table A', 'Table A'[Competenze_Ruoli], 'Table A'[Column] ),
SUMMARIZE ( 'Table B', 'Table B'[Competenze_Ruoli], 'Table B'[Column] )
)
)

@tamerj1 
no, I have to add the new column outside the DISTINCT.
The DISTINCT generates one, I have to add a second one in addition to the one generated by the DISTINCT...

@Morgana_2022 

It depends from which table, if you have relationships, based on which conditions.....

Morgana_2022
Helper I
Helper I

@tamerj1 
thanks, it works!

tamerj1
Super User
Super User

Hi @Morgana_2022 

distinct sum of what? Can you present sample of the the expected results?

I try to explain better...

I have a Table A
column "Competenze_Ruoli
with values
1
2
2
3
1
3

I have also a Table B
column "Competenze_Ruoli
with values
1
1
2
3
3
2

I must obtained a Table C
column "Competenze_Ruoli
with values
1
2
3

How do I get the Table C? What dax formula do I use?

@Morgana_2022 

Simply

Table C =

UNION (

VALUES ( 'Table A'[Competenze_Ruoli] ),

VALUES ( 'Table B'[Competenze_Ruoli] )

)

)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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