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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
MaryDay
Frequent Visitor

Duplicate column filter

Hello!

 

I have a column with duplicate values. I need to write a DAX code, that will produce 'true' if the value is repeated and 'false' if it is unique.

 

Example:

 

1   false

2   true

2   true

3   false

4   true

4   true

5   false

 

Help me, please.

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

I believe all you need to do is add another earlier statement related to the 2nd column.

Column =
If (
Calculate( Countrows( 'Table' ) ,
All( 'Table' ) [Column] = Earlier( [Column] ) ,
[Column2] = Earlier( [Column2] ) ) = 1 , "False" , "True" )


 


Connect on LinkedIn

View solution in original post

4 REPLIES 4
tex628
Community Champion
Community Champion

Column =
If (
Calculate( Countrows( 'Table' ) ,
All( 'Table' ) [Column] = Earlier( [Column] ) ) = 1 , "False" , "True" )

Connect on LinkedIn

It's perfect, thank you very much!

Maybe you know, how to do it, if I have 2 conditions? that is, I need to select values that are duplicated in both the first and second columns at the same time.

 

Example:

 

1    a    false

2    b    true

2    b    true

3    a    false

4    c    false

4    b    false

5    d    true

5    d    true

tex628
Community Champion
Community Champion

I believe all you need to do is add another earlier statement related to the 2nd column.

Column =
If (
Calculate( Countrows( 'Table' ) ,
All( 'Table' ) [Column] = Earlier( [Column] ) ,
[Column2] = Earlier( [Column2] ) ) = 1 , "False" , "True" )


 


Connect on LinkedIn

You helped me a lot, thank you very much! have a nice day!

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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