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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
han_rj
Helper IV
Helper IV

remove duplicate value within a row

Hi Team,

 

Need help with a solution that can remove duplicate values within a row in column product.

 

Before

IDNameProductLocation

1

AbleCan;Tin;Tin;Can100
2SamCan;Pan;Pan;Can;Bin101
3SanPole;Bin;Pin;Bin102

 

After

IDNameProductLocation

1

AbleCan;Tin100
2SamCan;Pan;Bin101
3SanPan;Bin102
1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

Add this line of code to your query

= Table.TransformColumns(previousQueryStep, {{"Product", each Text.Combine(List.Distinct(Text.Split(_, ";")), ";"), type text}})

 

Full example code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJMykkFUs6JedYhmRAMZANFDA0MlGJ1opWMgOzgxFyomgAoBrGdMiHqDMHqjMHqQCIB+TmpIEnrgEyEIiOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Name = _t, Product = _t, Location = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Name", type text}, {"Product", type text}, {"Location", Int64.Type}}),
    Custom1 = Table.TransformColumns(#"Changed Type", {{"Product", each Text.Combine(List.Distinct(Text.Split(_, ";")), ";"), type text}})
in
    Custom1




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
v-priyankata
Community Support
Community Support

Hi @han_rj 

Thank you for reaching out to the Microsoft Fabric Forum Community.

@jgeddes Thanks for the inputs.

I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.

 

jgeddes
Super User
Super User

Add this line of code to your query

= Table.TransformColumns(previousQueryStep, {{"Product", each Text.Combine(List.Distinct(Text.Split(_, ";")), ";"), type text}})

 

Full example code

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJMykkFUs6JedYhmRAMZANFDA0MlGJ1opWMgOzgxFyomgAoBrGdMiHqDMHqjMHqQCIB+TmpIEnrgEyEIiOl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Name = _t, Product = _t, Location = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Name", type text}, {"Product", type text}, {"Location", Int64.Type}}),
    Custom1 = Table.TransformColumns(#"Changed Type", {{"Product", each Text.Combine(List.Distinct(Text.Split(_, ";")), ";"), type text}})
in
    Custom1




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.