Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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,

 

ProductsDateRanks
Apple2020/12/011
Apple2020/12/022
Apple2020/12/043
Grapes2020/12/011
Grapes2020/12/032
Grapes2020/12/043
Grapes2020/12/054
Banana2020/12/011
Banana2020/12/032
  • Anonymous's avatar
    Anonymous
    5 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

  • Anonymous's avatar
    Anonymous
    Not 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.

  • 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 🙂


    Website YouTube  LinkedIn