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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Combining several strings from unknown number of lines

Hey everyone,

 

I have a problem where i need to combine an unknown number of strings.

 

I have a Sales table. For every sale i have an unknown number of Sales Lines connected to it.

On these Sales Lines there is a description field. I need a measure or calculated column that can run through these descriptions and give me a single string back on a new Column at Sales like this:

 

Sales No  |  Description

___________|_______________________
123          | "Description 1,
                |  Description 2,
                |  Description nth"

__________|________________________

234         | "Description 1"

__________|________________________

 

So in short it has to work with different number of strings for each row.

 

Please comment if you require more info

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this MEASURE

 

Measure =
CONCATENATEX (
    VALUES ( Table1[Description] ),
    [Description],
    ", ",
    [Description]
)

Regards
Zubair

Please try my custom visuals

View solution in original post

6 REPLIES 6
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try this MEASURE

 

Measure =
CONCATENATEX (
    VALUES ( Table1[Description] ),
    [Description],
    ", ",
    [Description]
)

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

This doesn't work so i'll clarify a bit futher

 

I have a table Sales.

 

For each Sale there are an unknown number of Sales Lines which have a column "Description".

 

I need to Concatenate all the Descriptions from the Sales Lines that are connected to that Sale and get that as a column (or measure) on the Sales table. So i need to filter it somehow.
With that method you posted it Concatenates ALL the descriptions of all Sales Lines for each Sale.

@Anonymous

 

Does your Table look like this

 

Sales No  Description

1234
1233
1232
1235
234107
234108
234100

 

 


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

That is correct.

 

On another table Sales i have the Header for the Sales lines (123, 234). And on this table i'd like another column where all the descriptions are concatenated together. but only for the right Sales No.

@Anonymous

 

Then the MEASURE I provided should work

 

Please see attached file

 

Probably you added it as a calculated column


Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

@Zubair_Muhammad

 

It does work.

 

I made a rookie mistake. Because i had so many descriptions it chose to cover the entire page with the Total, so i couldn't see the individual lines. 

 

I will mark it as solved with the Measure you posted at first. 😄

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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