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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bhanes22
Helper I
Helper I

Pull Distinct Values from concatenated column

I have this column in my table called specifications and it is set up so that each specification is delimited by a comma so it might be set up like so: 

SpecA,SpecB,SpecD

SpecB,SpecX,SpecD,

SpecY,SpecA,SpecB

etc. 

What I want is to transform this or create another column that gives me one one instance of each spec, so like: 

Spec A

Spec B

Spec C

Spec D

... and so on

I'm like 99% sure this can be done, and I even did it before apparentally but now for some reason in query editor its throwing an error so maybe I did it wrong? Idk what's going on with this column on my end, but it would be nice to see how someone more versed with Bi would accomplish this 

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @bhanes22 ,

 

yes, that's possible in Power Query. For that go to Transform --> Split Column and in the advanced options choose "Rows":

selimovd_1-1629483497221.png

 

Afterwards you have to remove the duplicates and then the data is like you wanted:

selimovd_3-1629483579179.png

 

This here was my example:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi5ITXbUAZFOYNJFKVYHIgrhR6CJRuog6VCKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Specs = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Specs", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Specs", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Specs"),
    #"Removed Duplicates" = Table.Distinct(#"Split Column by Delimiter")
in
    #"Removed Duplicates"

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @bhanes22,

Did selimovd 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept his suggestions to help others who faced similar requirements to find it more quickly.

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

selimovd
Super User
Super User

Hey @bhanes22 ,

 

yes, that's possible in Power Query. For that go to Transform --> Split Column and in the advanced options choose "Rows":

selimovd_1-1629483497221.png

 

Afterwards you have to remove the duplicates and then the data is like you wanted:

selimovd_3-1629483579179.png

 

This here was my example:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCi5ITXbUAZFOYNJFKVYHIgrhR6CJRuog6VCKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Specs = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Specs", type text}}),
    #"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Changed Type", {{"Specs", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Specs"),
    #"Removed Duplicates" = Table.Distinct(#"Split Column by Delimiter")
in
    #"Removed Duplicates"

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors