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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.