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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors