Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Friends,
I need help on counting duplicate values and number them as 1,2,3 through measures. I have the following tables -
Account Number | Meter ID | Date |
11111111 | X1 | 1/1/2023 0:00 |
11111111 | X2 | 2/1/2023 0:00 |
11111111 | X3 | 3/1/2023 0:00 |
11111111 | X4 | 4/1/2023 0:00 |
11111111 | X5 | 5/1/2023 0:00 |
22222222 | X6 | 1/1/2023 0:00 |
22222222 | X7 | 2/1/2023 0:00 |
22222222 | X8 | 3/1/2023 0:00 |
33333333 | X9 | 4/1/2023 0:00 |
44444444 | X10 | 3/24/2023 0:00 |
I want to add a rank column which should be looking like
Rank | Account Number | Meter ID | Date |
1 | 11111111 | X1 | 1/1/2023 0:00 |
2 | 11111111 | X2 | 2/1/2023 0:00 |
3 | 11111111 | X3 | 3/1/2023 0:00 |
4 | 11111111 | X4 | 4/1/2023 0:00 |
5 | 11111111 | X5 | 5/1/2023 0:00 |
1 | 22222222 | X6 | 1/1/2023 0:00 |
2 | 22222222 | X7 | 2/1/2023 0:00 |
3 | 22222222 | X8 | 3/1/2023 0:00 |
1 | 33333333 | X9 | 4/1/2023 0:00 |
1 | 44444444 | X10 | 3/24/2023 0:00 |
I am able to do that using calculated column but i am not able to create it through measure.
Any help and thoughts will be highly appriciated.
PowerBI File Link - https://drive.google.com/file/d/1C-zW3m1AgWw3qHcEj-8gL3FQr2ejWk2y/view?usp=sharing
Solved! Go to Solution.
rank =
RANKX (
FILTER ( ALL ( tbl ), tbl[Account Number] = MAX ( tbl[Account Number] ) ),
CALCULATE ( MAX ( tbl[Date] ) ),
,
ASC,
DENSE
)
rank =
RANKX (
FILTER ( ALL ( tbl ), tbl[Account Number] = MAX ( tbl[Account Number] ) ),
CALCULATE ( MAX ( tbl[Date] ) ),
,
ASC,
DENSE
)
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
7 |