Forum Discussion
Creating a Ranking according to a date
- 5 years ago
Hi, Acamara
Create a calculated column to extract the month in the date,
_Month = MONTH ( 'Table'[Date] )Then, try to create a measure like below:
_Rank measure = RANKX ( ALLEXCEPT ( 'Table', 'Table'[_Month] ), CALCULATE ( SUM ( 'Table'[Sales] ) ), , DESC, DENSE )I created a simple sample to illustrate this.
Sample:
Result:
Please refer to the attachment below for details
Is this the result you want? Hope this is useful to you
Please feel free to let me know If you have further questions
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi
If you would like to rank month-wise, then I would suggest doing the following:
Create a new column, extracting the month from the date.
Next, create a SUMMARIZE table, go to the modeling tab, click the new table and add the following:
TableSummarize = SUMMARIZECOLUMNS(‘Table’[Product], ‘Table’[Month], "Total Sales", SUM(Table[Sales]) )
Now in above table, add new calculated field for rank:
Rank = RANKX(
Filter(
TableSummarize,
TableSummarize[Month] = EARLIER(TableSummarize[Month])
),
TableSummarize[Total Sales],,
DESC,Dense
)
Let me know if this works. Thanks
- Acamara5 years agoFrequent Visitor
Hi Murtaza.
Thanks for your help!
I fear that it may not worked. Here is what happnened when I've tried.