Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone
Hope that you people are doing great. I am facing a problem as explained below. Any help would be greatly appreciated.
I have the following example data.
order_id orderline_id service_type country
1 1 service_type_1 Belgium
1 2 service_type_2 France
1 3 service_type_3 Italy
2 1 service_type_1 UK
2 2 service_type_2 USA
Order ID is a unique ID for each order. I want to add another column to combine all the countries under a specific order ID, separated by comma, for each order line.
after adding new column data will look like as follow.
order_id orderline_id service_type country new_column
1 1 service_type_1 Belgium Belgium, France, Italy
1 2 service_type_2 France Belgium, France, Italy
1 3 service_type_3 Italy Belgium, France, Italy
2 1 service_type_1 UK UK, USA
2 2 service_type_2 USA UK, USA
Thank you so much.
Solved! Go to Solution.
pls try this
Column =
var tbl=SUMMARIZE('Table','Table'[order_id],'Table'[country])
return CONCATENATEX(FILTER(tbl,'Table'[order_id]=EARLIER('Table'[order_id])),'Table'[country],",")
Proud to be a Super User!
you can create a new column
Column =
CONCATENATEX(FILTER('Table','Table'[order_id ]=EARLIER('Table'[order_id ])),'Table'[country],",")
Proud to be a Super User!
Thank you @ryan_mayu for your quick response.
There is a problem with existing solution. The problem is that if the country is repeated against a single order Id. Like if in above example for order id 2 , service_type_3 the country is again France there output will be Belgium, France, France.
But the intended result shoul be Belgium, France
Can you please help figure out this?
pls try this
Column =
var tbl=SUMMARIZE('Table','Table'[order_id],'Table'[country])
return CONCATENATEX(FILTER(tbl,'Table'[order_id]=EARLIER('Table'[order_id])),'Table'[country],",")
Proud to be a Super User!
you are welcome
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
67 | |
51 | |
38 | |
26 |
User | Count |
---|---|
88 | |
52 | |
45 | |
39 | |
38 |