Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Solved! Go to Solution.
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" )
Column = If ( Calculate( Countrows( 'Table' ) ,
All( 'Table' ) [Column] = Earlier( [Column] ) ) = 1 , "False" , "True" )
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
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" )
You helped me a lot, thank you very much! have a nice day!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |