Forum Discussion
jjones90274
3 years agoFrequent Visitor
DAX RANKX by Quarter
I am having issues creating a RANKX function that ranks values that are in the same period. My data contains multiple cities with multiple years and quarters for each city (Ex: Dallas for 1Q 2021, 2Q...
amitchandak
3 years agoSuper User
jjones90274 , Try measure like
Rankx(allselected(Table[City]) , CALCULATE(SUM('Costar Data'[Vacancy Rate])), , desc,dense)
Rankx(filter(allselected(Table[City], Table[Qtr Year]), [Qtr Year] =max(Table[Qtr Year]) , CALCULATE(SUM('Costar Data'[Vacancy Rate])), , desc,dense)
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
jjones90274
3 years agoFrequent Visitor
I also tried another method that got me close but it is still off. It does not seem to be ranking properly and the ranking does not start at 1 (see below):
The formula for GSVacancy Rank is:
GSVacancy Rank =
CALCULATE(
RANKX(ALL('GreenStreet-Data-2022-08-30'[Market]),[Measure - CoStar Vacancy],,ASC,Dense),
ALL('GreenStreet-Data-2022-08-30'),
VALUES('GreenStreet-Data-2022-08-30'[Market]))