This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
Hi,
I need to write a power query for a text filed if the same data is repeated in another cell in same column needs to print as duplicate in new column else print unique.
Ex. if phone number is repeated again in same column, in new column it needs to print as duplicate else unique
Solved! Go to Solution.
Look here for steps which you can incorporate
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NYyxDcAwCAR3oXbDm1hunYyB2H+NPDYuXrqTONxFVZosjhDNBZ38coT0x8gfR0hX3HtsH6OckN5LT207T7fqgfv/9HOWEyJ+", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Term_Guid = _t, Term_Name = _t, Term_XYZ = _t]),
#"Grouped Rows" = Table.Group(Source, {"Term_Name"}, {{"Term_Name_Count", each Table.RowCount(_), Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(Source, {"Term_Name"}, #"Grouped Rows", {"Term_Name"}, "Grouped Rows", JoinKind.LeftOuter),
#"Expanded Grouped Rows" = Table.ExpandTableColumn(#"Merged Queries", "Grouped Rows", {"Term_Name_Count"}, {"Term_Name_Count"}),
#"Added Custom" = Table.AddColumn(#"Expanded Grouped Rows", "Custom", each if [Term_Name_Count]>1 then "Duplicate" else "Unique"),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Term_Name_Count"})
in
#"Removed Columns"
Look here for steps which you can incorporate
See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("NYyxDcAwCAR3oXbDm1hunYyB2H+NPDYuXrqTONxFVZosjhDNBZ38coT0x8gfR0hX3HtsH6OckN5LT207T7fqgfv/9HOWEyJ+", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Term_Guid = _t, Term_Name = _t, Term_XYZ = _t]),
#"Grouped Rows" = Table.Group(Source, {"Term_Name"}, {{"Term_Name_Count", each Table.RowCount(_), Int64.Type}}),
#"Merged Queries" = Table.NestedJoin(Source, {"Term_Name"}, #"Grouped Rows", {"Term_Name"}, "Grouped Rows", JoinKind.LeftOuter),
#"Expanded Grouped Rows" = Table.ExpandTableColumn(#"Merged Queries", "Grouped Rows", {"Term_Name_Count"}, {"Term_Name_Count"}),
#"Added Custom" = Table.AddColumn(#"Expanded Grouped Rows", "Custom", each if [Term_Name_Count]>1 then "Duplicate" else "Unique"),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Term_Name_Count"})
in
#"Removed Columns"
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.