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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
AleksandrMe
Resolver I
Resolver I

replace Duplicate values for each source in the one query

Good day All, 

 

I have a query consists of varius sorce files. Some files have dublications. Is there is a way to exchage dublicated values within the query but for each source only, see below:

 

AleksandrMe_0-1635263434516.png

1 need only one 2nd officer in each sorce, only one 3rd officer within one sorce etc... 

 

Thnaks

Aleks 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @AleksandrMe ,

Perhaps you can try:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1NFfSUTLKS1HwT0vLTE4tUorVQZbxKtJTMMYpa1yES8apKDMlPVUhJDUxF0nGEijjm1hcgqIcJOickZmahsUoS5yOs8RpPX4ZrA4zMsDiMLAgDoeB5bA6jIAMVoeBZVAcFgsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Source = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Source", type text}, {"Value", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Source"}, {{"Data", each _, type table [Source=nullable text, Value=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.Distinct([Data])),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Value"}, {"Value"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Data"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Value", type text}})
in
    #"Changed Type1"

vyingjl_0-1635486418058.pngvyingjl_1-1635486427085.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @AleksandrMe ,

Perhaps you can try:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1NFfSUTLKS1HwT0vLTE4tUorVQZbxKtJTMMYpa1yES8apKDMlPVUhJDUxF0nGEijjm1hcgqIcJOickZmahsUoS5yOs8RpPX4ZrA4zMsDiMLAgDoeB5bA6jIAMVoeBZVAcFgsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Source = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Source", type text}, {"Value", type text}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Source"}, {{"Data", each _, type table [Source=nullable text, Value=nullable text]}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.Distinct([Data])),
    #"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Value"}, {"Value"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded Custom",{"Data"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Removed Columns",{{"Value", type text}})
in
    #"Changed Type1"

vyingjl_0-1635486418058.pngvyingjl_1-1635486427085.png

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

edhans
Community Champion
Community Champion

How to get good help fast. Help us help you.

How To Ask A Technical Question If you Really Want An Answer

How to Get Your Question Answered Quickly - Give us a good and concise explanation
How to provide sample data in the Power BI Forum - Provide data in a table format per the link, or share an Excel/CSV file via OneDrive, Dropbox, etc.. Provide expected output using a screenshot of Excel or other image. Do not provide a screenshot of the source data. I cannot paste an image into Power BI tables.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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