Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sort by Year and Month

Hi All,   I have a table mentioned as below, I would like to sort it based on year and Month Number.  how can i achieve it in DAX query or Powe BI visual Year Month Month Number 2020 Augu...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous,

     

    Please try this column.

     

     

    Rank = 
    RANKX(
        'Table',
        RANKX('Table','Table'[Year],,0)
        +DIVIDE(RANKX('Table','Table'[MonthNumber],,1),COUNTROWS('Table')+1)
    )

     

     

    The result should be like this.

     

    Best Regards,

    Community Support Team _ Gao

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!