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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
bugs84
Frequent Visitor

Concatenatex related distinct values

Hello everyone.

I have a measure in a table that gets the concatenation of values in a different table:

 

ListProductTypes = CONCATENATEX(Product;Product[ProductType];", ")

 

Work perfectly, but since I have many related Products (often with the same ProductType), I get an awful repetition of same values

 

e.c. Type1, Type1, Type2, Type2....

 

I only need to get (in this case) the distinct Type1, Type2

 

therefore i need something like ListProductTypes = CONCATENATEX(Product; DISTINCT ( Product[ProductType] ) ;", ")

 

but it doesn't work...

help would be appreciated

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@bugs84

 

Try chnaging the location of DISTINCT

 

ListProductTypes = CONCATENATEX(DISTINCT(Product);Product[ProductType]  ;", ")

 

 

or

 

ListProductTypes = CONCATENATEX(VALUES(Product);Product[ProductType]  ;", ")

 

View solution in original post

6 REPLIES 6
mahdi1985
Frequent Visitor

Hi everyone,

I have a table:

 

Col1           ,Col2


a 1
b 2
c 3
a 4
b 5
c 6
a 7
b 8
c 9
d 10
e null
f null
g null


i want to concatenate the column Col2 to get:

a 1,4,7
b 2,5,8
c 3,6,9
d 4,7,10
e
f
g

Here is the formula i used: «CONCATENATEX(Merge1,Merge1[Col2],"; ")»

The result i get is:

a 1,2,3,4,5,6,7,8,9,10,,,
b 1,2,3,4,5,6,7,8,9,10,,,
c 1,2,3,4,5,6,7,8,9,10,,,
d 1,2,3,4,5,6,7,8,9,10,,,
e 1,2,3,4,5,6,7,8,9,10,,,
f 1,2,3,4,5,6,7,8,9,10,,,
g 1,2,3,4,5,6,7,8,9,10,,,

i'm not sure if i missed something

Thank you for your help,

Hi,

 

Sorround it with CALCULATE, it should works.

CALCULATE(CONCATENATEX(Merge1,Merge1[Col2],"; "))

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @bugs84,

 

Have you tried the solution provided by @Zubair_Muhammad above? Does it work in your scenario? If it works, could you accept it as solution to close this thread?

 

If you still have any question on this issue, feel free to post here. Smiley Happy

 

Regards

Zubair_Muhammad
Community Champion
Community Champion

@bugs84

 

Try chnaging the location of DISTINCT

 

ListProductTypes = CONCATENATEX(DISTINCT(Product);Product[ProductType]  ;", ")

 

 

or

 

ListProductTypes = CONCATENATEX(VALUES(Product);Product[ProductType]  ;", ")

 

This only works if the Product table has just one column. Else you need to write Product[ProductType] as the table so that you have only this one column to get the distinct values from:

 

ListProductTypes = CONCATENATEX(DISTINCT(Product[ProductType]);Product[ProductType]  ;", ")

 

See CONCATENATEX providing unique (distinct) values – Trainings, consultancy, tutorials.

Thank you very much!

I tried the first solution and it works perfectly! Woman Very Happy

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.