Forum Discussion
RANKX between DATES
- 6 years ago
Anonymous , if you are creating the column refer 2nd one and if you are creating measure 1st one
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 - 6 years ago
Think expression should give you the calculated column you are looking for. I added a month column, but it would work with the data you posted if you just replace [Month] with [Date] in both places.
Rank Same Month = var currentmonth = PayTable[Month]var ranksamemonth = RANKX(FILTER(PayTable, PayTable[Month]=currentmonth), PayTable[Pay],,ASC)return ranksamemonthIf this works for you, please mark it as the solution. Kudos are appreciated too.Regards,Pat - 5 years ago
@Rich_coutinho , if you are creating the column, see the 2nd and if you are creating the 1st measure
For range, see 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
Hi Anonymous ,
If you want a calculate column, the Mahoneypat’s solution works fine.
But if you want to create a measure, you can refer the following measure.
Measure =
var day_ = MONTH(MAX('Table'[date]))
var year_ = YEAR(MAX('Table'[date]))
return
IF(
HASONEVALUE('Table'[date]),
RANKX (
FILTER(ALLSELECTED('Table'[date]),MONTH('Table'[date])=day_ && YEAR('Table'[date])=year_),
CALCULATE(SUM('Table'[pay])), ,
ASC,
DENSE
))
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.