The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I need create Sequence number using DAX function. Here is an example
DEPT NO EMP NO SEQNO
10 100 3
10 200 2
10 300 1
20 400 3
20 500 2
20 600 1
I tried using Rankx but could not get it right.
Thanks
Solved! Go to Solution.
Hi @dp106,
For calculated column,
SEQNO = RANKX ( FILTER ( Table8, Table8[DEPT NO] = EARLIER ( Table8[DEPT NO] ) ), Table8[EMP NO], , DESC, DENSE )
For measure,
SEQNO measure = RANKX ( ALLEXCEPT ( Table8, Table8[DEPT NO] ), CALCULATE ( SUM ( Table8[EMP NO] ) ), , DESC, DENSE )
Best regards,
Yuliana Gu
Hi @dp106,
For calculated column,
SEQNO = RANKX ( FILTER ( Table8, Table8[DEPT NO] = EARLIER ( Table8[DEPT NO] ) ), Table8[EMP NO], , DESC, DENSE )
For measure,
SEQNO measure = RANKX ( ALLEXCEPT ( Table8, Table8[DEPT NO] ), CALCULATE ( SUM ( Table8[EMP NO] ) ), , DESC, DENSE )
Best regards,
Yuliana Gu
Hi @dp106
Do you want to follow the order of 'EMP NO'?
Show your code for RANKX and we can have a look
User | Count |
---|---|
77 | |
75 | |
36 | |
31 | |
28 |
User | Count |
---|---|
106 | |
98 | |
55 | |
49 | |
48 |