Forum Discussion
How to sort a table by two columns using date and a number
- 8 years ago
Hi M_Potts,
As mentioned in above link you provided, the highlighted part should measures rather than original table columns.
In your scenario, please create two extra measures:
primary measure = MAX('Table'[Date]) secondary measure = MAX('Table'[Number])Then, modify your final rank measure to:
Final Rank = RANKX ( ALL ( 'Table'), RANKX ( ALL ( 'Table' ), [primary measure],, DESC ) + DIVIDE ( RANKX ( ALL ( 'Table' ), [secondary measure],, DESC ), ( COUNTROWS ( ALL ( 'Table' ) ) + 1 ) ) )Best regards,
Yuliana Gu
Hi M_Potts,
As mentioned in above link you provided, the highlighted part should measures rather than original table columns.
In your scenario, please create two extra measures:
primary measure = MAX('Table'[Date])
secondary measure = MAX('Table'[Number])
Then, modify your final rank measure to:
Final Rank =
RANKX (
ALL ( 'Table'),
RANKX ( ALL ( 'Table' ), [primary measure],, DESC )
+ DIVIDE (
RANKX ( ALL ( 'Table' ), [secondary measure],, DESC ),
( COUNTROWS ( ALL ( 'Table' ) ) + 1 )
)
)
Best regards,
Yuliana Gu
- M_Potts8 years agoFrequent Visitor
Hi v-yulgu-msft!
Thank you, this worked perfectly!
For anyone who is a bit of a noob like me, once you've done the above solution, remember to search for the new column 'Final Rank' in your table so that you can order it according to your specs (as in the picture provided in the above post).