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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Ashish_Mathur
Super User
Super User

Rank of month

Hi,

For sheer simplicity, i have just one table called Calender with consecutive dates, year, month number, month name and day of week.  In the slicer, i have selected the year as 2019.  In the Table visual, i have dragged Year and Month Name from the Calender Table (the only table in the PBI file).  I have then written a measure called Month of current row = MONTH(MIN(Calender[Date])).  No problem so far.  Now i want to rank the month names (in ascending order) by writing a measure.  So the answer i am expecting to see is numbers from 1 to 12 (same as the month numbers).  However, when i write this measure, then i get all 1's

Measure = RANKX(ALL(Calender[Month Name]),[Month of current row])

Where is my mistake?

Thank you for your help.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
1 ACCEPTED SOLUTION
AntrikshSharma
Super User
Super User

Measure =
RANKX (
    ALL ( Dates[Month] ),
    CALCULATE ( [Month of Current row], ALLEXCEPT ( Dates, Dates[Month] ) ),
    ,
    ASC
)

View solution in original post

2 REPLIES 2
AntrikshSharma
Super User
Super User

Measure =
RANKX (
    ALL ( Dates[Month] ),
    CALCULATE ( [Month of Current row], ALLEXCEPT ( Dates, Dates[Month] ) ),
    ,
    ASC
)

Thank you.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.