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

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

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.