Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
yforti13
Regular Visitor

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:

yforti13_1-1744266726547.png

yforti13_4-1744266948515.png

 

 

yforti13_0-1744266669706.png
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?


 

1 ACCEPTED SOLUTION

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

View solution in original post

6 REPLIES 6
v-sdhruv
Community Support
Community Support

Hi @yforti13 ,
I hope this information was helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-sdhruv
Community Support
Community Support

Hi @yforti13 ,
I hope this information was helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-sdhruv
Community Support
Community Support

Hi @yforti13 ,
I hope this information was helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

v-sdhruv
Community Support
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:

https://community.fabric.microsoft.com/t5/Desktop/Top-N-Ranking-for-specific-year/m-p/2122020#M78512...

Hope this helps!

 

pankajnamekar25
Super User
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 | LinkedIn

If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.