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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Lachlanpap
Frequent Visitor

DAX concatenate based on matching value

I would like to create a column that concatenates the 'Name' column with a comma to seperate names if the 'SessionId' column matches. 

 

I'm not sure if this is possible? Any help would be appreciated. Thanks

 

Lachlanpap_0-1724056387013.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Lachlanpap ,

The Concet in rajendraongole1's expression is a table name, you can replace it with your own table name, and you can also refer to the following expression.

Column = CONCATENATEX(FILTER('Table',[SessionId]=EARLIER('Table'[SessionId])),[Name],",")

Output

vxinruzhumsft_0-1724119400663.png

If the solutions rajendraongole1 and I offered help you, you can consider to accept them as solutions so that more user can refer to.

 

Best Regards!

Yolo Zhu

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
Lachlanpap
Frequent Visitor

Thanks Yolo Zhu. Looks like there is a few ways to solve the same problem. I ended up using your expression Yolo. Thank you for introducing me to the EARLIER function. Thanks @rajendraongole1 for your help also. 

rajendraongole1
Super User
Super User

Hi @Lachlanpap - create below calcualted column to get the concatenation based on session id columns.

ConcatenatedNames =
VAR CurrentSessionId = Concet[SessionId]
RETURN
CALCULATE(
    CONCATENATEX(
        ALL(Concet),
        IF(Concet[SessionId] = CurrentSessionId, Concet[Name], BLANK()),
        ", "
    )
)

rajendraongole1_0-1724058318476.png

 

Check it and let know.

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks rajendragongole1. Appreciate your assistance. The calculated column doesn't seem to work. I understand the concept of a variable but can you please explain what 'concet' is? This doesn't seem to be a DAX expression. Thanks, Lachlan

Hi @Lachlanpap -  "concet" is the table name i have used to derive the above logic.

 

Thank you





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Anonymous
Not applicable

Hi @Lachlanpap ,

The Concet in rajendraongole1's expression is a table name, you can replace it with your own table name, and you can also refer to the following expression.

Column = CONCATENATEX(FILTER('Table',[SessionId]=EARLIER('Table'[SessionId])),[Name],",")

Output

vxinruzhumsft_0-1724119400663.png

If the solutions rajendraongole1 and I offered help you, you can consider to accept them as solutions so that more user can refer to.

 

Best Regards!

Yolo Zhu

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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