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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
selimovd
Super User
Super User

Concatenate distinct values from column in Measure

Hello everyone,

 

I have the following table:

pbi1.png

 

 

 

 

 

 

 

 

What I need now is the summary by year, but I also want to concatenate the unique values in the column status.

This column can anyway just contain 2 values, but on the summary level I have to know if the column contains just "Value" or also "Another Value".

So the result should look like that:

pbi2.png

 

Does anyone have an idea if this is possible?

 

Thank you and best regards

 

1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @selimovd 

You can use DAX expression like below.

Measure = 
CONCATENATEX(
    VALUES(YourTable[First Status]),
    YourTable[First Status], ", "
)

Regards,
Mariusz

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

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @selimovd 

You can use DAX expression like below.

Measure = 
CONCATENATEX(
    VALUES(YourTable[First Status]),
    YourTable[First Status], ", "
)

Regards,
Mariusz

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

Hello, 

 

I can't figure out why this approach doesn't work for me.  I have one table with just two fields, CallSign and Frequency.  I am creating a measure called AllFreq with the following equation AllFreq = CONCATONATEX(VALUES('FR'),'FR'[Frequency]," ,").  When I do a visual of CallSign and AllFreq, I get examples like this:  453.05 ,453.05 ,453.05 ,453.275 ,453.275 ,453.275 ,453.45 ,453.45 ,453.45 ,453.725 ,453.725 ,458.05 ,458.05 ,458.05 ,458.275 ,458.275 ,458.275 ,458.45 ,458.45 ,458.45 ,458.45 ,458.725 ,458.725. You can see there are many duplicates.  And, there's no differenece if I remove the VALUES function:  453.05 ,453.05 ,453.05 ,453.275 ,453.275 ,453.275 ,453.45 ,453.45 ,453.45 ,453.725 ,453.725 ,458.05 ,458.05 ,458.05 ,458.275 ,458.275 ,458.275 ,458.45 ,458.45 ,458.45 ,458.45 ,458.725 ,458.725.

 

Can someone help?  Is this old functionality that has since been updated?

 

Thanks,

 

Joe Ross

Hi @josephjross2 

 

I think the problem is with VALUES( 'FR' ) - you passed a table as an argument but VALUES expected a column.

try this

Measure = 
CONCATENATEX( 
    VALUES( 'FR'[Frequency] ),
    'FR'[Frequency], ", "
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Perfect!  Thanks so much @Mariusz !  I thought that had to be a whole table and not a single field.  I appreciate the response and the help!  

 

Joe

Thank you @Mariusz this was exactly what I was searching for!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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