Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I created a table using the 'earlier' dax function, but I am now having problems dealing with the duplicates.
The tables below would illustrate.
| Activity ID | Department | Date | Count | |||
| 1203993 | Young | 15-03-2021 | 20 | |||
| 1394994 | Young | 15-03-2021 | 20 | |||
| 1475478 | Young | 15-03-2021 | 20 | |||
| 1458990 | Young | 15-03-2021 | 20 | |||
| 1457373 | Young | 16-03-2021 | 16 | |||
| 1243536 | Young | 16-03-2021 | 16 | |||
| 5647747 | Ran | 13-03-2021 | 14 | |||
| 5657757 | Ran | 13-03-2021 | 14 | |||
| 7907000 | Ran | 15-03-2021 | 12 | |||
| 5768688 | Ran | 15-03-2021 | 12 | |||
| 5767678 | Ran | 15-03-2021 | 12 |
I am thinking the way to do this would be to create a new index column that gives unique indexes based on filtering criteria as below:
| Activity ID | Department | Date | Count | Index | ||||
| 1203993 | Young | 15-03-2021 | 20 | 1 | ||||
| 1394994 | Young | 15-03-2021 | 20 | 2 | ||||
| 1475478 | Young | 15-03-2021 | 20 | 3 | ||||
| 1458990 | Young | 15-03-2021 | 20 | 4 | ||||
| 1457373 | Young | 16-03-2021 | 16 | 1 | ||||
| 1243536 | Young | 16-03-2021 | 16 | 2 | ||||
| 5647747 | Ran | 13-03-2021 | 14 | 1 | ||||
| 5657757 | Ran | 13-03-2021 | 14 | 2 | ||||
| 7907000 | Ran | 15-03-2021 | 12 |
| 1 | |||
| 5768688 | Ran | 15-03-2021 | 12 | 2 | ||||
| 5767678 | Ran | 15-03-2021 | 12 | 3 |
The index would be based on the Activity ID (which are string elements). So invariably, the table is filtered for Department and Dates then an index is generated based on the alphabetical ordering of the Activity ID. I can then filter out the duplicates by selecting the Index 1 as below.
| Activity ID | Department | Date | Count | Index | ||||
| 1203993 | Young | 15-03-2021 | 20 | 1 | ||||
| 1457373 | Young | 16-03-2021 | 16 | 1 | ||||
| 5647747 | Ran | 13-03-2021 | 14 | 1 | ||||
| 7907000 | Ran | 15-03-2021 | 12 |
| 1 |
I have tried using rank and calculate, but generated error. I would appreciate if someone can advice what to do...or maybe an easier way to deal with duplicates after using the earlier function.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |