Forum Discussion
HELP dax rankx
Hi guys!
I'm trying to sort the top 20 values in my table, but I'm encountering the following scenario:
My measure:
As you can see below, there are values for past months, but I wanted to sort the values for the current month (February):
Can someone help me?
i didn't understand 😕
Like this?RankingTableCNE180d =VAR _x =RANKX(ALL(d_DemaisConvenios),CALCULATE([m_CNE180],'d_Calendario'[Date] >= DATE(2025, 02, 01),'d_Calendario'[Date] <= DATE(2025, 02, 29)))RETURN_x
6 Replies
- pankajnamekar25
Super User
Hello yforti13 ,
You can try this measure
RankingTableCNE180d =
VAR _x =
RANKX(
...
CALCULATE(
[r_CNE180d],
'd_Calendario'[Date] >= DATE(2025, 02, 01),
'd_Calendario'[Date] <= DATE(2025, 02, 29)
)
)
...
RETURN
SWITCH(TRUE()Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
- yforti13Regular Visitor
i didn't understand 😕
Like this?RankingTableCNE180d =VAR _x =RANKX(ALL(d_DemaisConvenios),CALCULATE([m_CNE180],'d_Calendario'[Date] >= DATE(2025, 02, 01),'d_Calendario'[Date] <= DATE(2025, 02, 29)))RETURN_x
- v-sdhruv
Community Support
Hi yforti13 ,
You cannot directly sort any specific column in matrix.
Using the sort functionality in matrix it will sort for the entire data and not for a particular column.However, if you wish to achieve this by using RANK function, you can refer this solution:
Hope this helps!