Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have encountered some challenges in attempting to achieve the following task. Identifying duplicates becomes straightforward when considering entire columns, but my objective is to identify duplicates from Column A within each individual row seperated by commas. Is this achievable using Power BI DAX? The desired results are outlined below. Please note that Column A is a calculated column, and we are restricted from making modifications in M.
A | Duplicates |
a,b,b,c | b |
a,a,b,b,c,c | a,b,c |
a,b,c | |
a,a,b | a |
Any help is greatly appreciated, thank you so much.
Solved! Go to Solution.
Thank you! I tried but it is showing error for [Name] at the very last line.
I modified a little and it works!
Hi @Anonymous,
I guess the proper approach is to use Power Query and @ThxAlot's solution, but here's a DAX way to solve this:
The same in plain text:
Duplicates =
VAR CurrentItem = [A]
VAR WorkItem = SUBSTITUTE ( CurrentItem, ",", "|" )
VAR Qty = LEN ( CurrentItem ) - LEN ( SUBSTITUTE ( CurrentItem, ",", "" ) ) + 1
VAR _tbl = GENERATESERIES ( 1, Qty )
VAR _tbl2 = ADDCOLUMNS ( _tbl,
"Name",
PATHITEM ( WorkItem, [Value] ) )
VAR _tbl3 = SUMMARIZE ( _tbl2, [Name],
"Qty",
VAR CurrentName = [Name]
RETURN COUNTROWS ( FILTER ( _tbl2, [Name] = CurrentName ) ) )
RETURN CONCATENATEX ( SELECTCOLUMNS ( FILTER ( _tbl3, [Qty] > 1 ), [Name] ), [Name], "," )
Best Regards,
Alexander
Thank you! I tried but it is showing error for [Name] at the very last line.
I modified a little and it works!
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WStRJAsJkpVgdEBvKg/NRZJRiYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Str = _t]),
#"Added Dupliate" = Table.AddColumn(Source, "Dup", each let l = Text.Split([Str], ",") in Text.Combine(List.Distinct(List.Select(l, each List.Count(List.PositionOf(l, _, Occurrence.All))>1)), ","))
in
#"Added Dupliate"
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
71 | |
56 | |
39 | |
35 |
User | Count |
---|---|
66 | |
66 | |
59 | |
53 | |
45 |