Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi everyone, are you guys doing well?
I have a complicated challenge here to add a new column to my table,
Basically, I need to count duplicate ID's, and after that, I need to write "1" into one of the X rows that are duplicates,
For example, as in my table below, the ID "X1" repeats 4 times, then I need to write "1" as result into any row, and "0" for the remaining ones,
I have tried to use the expressions Countrows with Earlier function, but It will always give me just the repetition count,
Solved! Go to Solution.
@Anonymous
Please try
Expected Result =
IF (
'Table'[Date]
= CALCULATE ( MIN ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
1,
0
)
Hi @Anonymous
Do you have a date or index column?
Hi tamerj1,
Yes, I have a column date, but the column index no,
@Anonymous
Please try
Expected Result =
IF (
'Table'[Date]
= CALCULATE ( MIN ( 'Table'[Date] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ),
1,
0
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 16 | |
| 8 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 25 | |
| 13 | |
| 12 | |
| 10 | |
| 6 |