Forum Discussion
Ranking by Date
Hi everyone,
I want to create a table that will allow me to rank the values based on the dates. I also wants this to work with the slicers in have in my report.
For instance,
| Products | Date | Ranks |
| Apple | 2020/12/01 | 1 |
| Apple | 2020/12/02 | 2 |
| Apple | 2020/12/04 | 3 |
| Grapes | 2020/12/01 | 1 |
| Grapes | 2020/12/03 | 2 |
| Grapes | 2020/12/04 | 3 |
| Grapes | 2020/12/05 | 4 |
| Banana | 2020/12/01 | 1 |
| Banana | 2020/12/03 | 2 |
- Anonymous5 years ago
Hi Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure = RANKX( FILTER(ALL('Table'),'Table'[Products]=MAX('Table'[Products])), SUMX(RELATEDTABLE('Table'),'Table'[Date]),,ASC)2. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- AnonymousNot applicable
Hi Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure = RANKX( FILTER(ALL('Table'),'Table'[Products]=MAX('Table'[Products])), SUMX(RELATEDTABLE('Table'),'Table'[Date]),,ASC)2. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Fowmy
Super User
Anonymous
Please try the following measure:
Rank M = RANKX( FILTER(ALL('Table3'),'Table3'[Products]=SELECTEDVALUE('Table3'[Products])), CALCULATE( MAX(Table3[Date])),, ASC )________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply 🙂