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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to work with arrays in PowerBI?

Hello

 

I have the data below:

A, 1

A, 2

A, 3

B, 1

B, 2

 

How can I specify the array for Column2 per value of Column1 and output it into a comma separated string in ascending order?

I.e.:

 

A; 1,2,3

B; 1,2

 

Thanks!

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@Anonymous 

Measure =
CONCATENATEX ( DISTINCT ( Table1[Col2] ), Table1[Col2], ",", Table1[Col2], ASC  )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

4 REPLIES 4
AlB
Community Champion
Community Champion

Hi @Anonymous 

1. Place Col1 on a table visual

2. Place this measure in the visual 

Measure =
CONCATENATEX ( DISTINCT ( Table1[Col2] ), Table1[Col2], "," )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Anonymous
Not applicable

Thanks, what is the orderby expression for ascending order please?

AlB
Community Champion
Community Champion

@Anonymous 

Measure =
CONCATENATEX ( DISTINCT ( Table1[Col2] ), Table1[Col2], ",", Table1[Col2], ASC  )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

amitchandak
Super User
Super User

@Anonymous , You can create a measure on second column

new measure = concatenatex(Table, Table[Col2])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.