Forum Discussion

JustinDoh1's avatar
JustinDoh1
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

How to sort Month under Year hierarchy

I am attaching my Pbix file here.   I am trying to order month in descending order (in a slicer). Example: Feb --> Jan for 2022 Dec --> Nov --> Oct ... --> Jan for 2021. This is what I have now...
  • amitchandak's avatar
    4 years ago

    JustinDoh1 , Create two columns in your table

     

    Month1 = FORMAT([Date],"mmm")
    Month1 sort = month([DAte])

    Month Rank = RANKX(ALL('Date'),'Date'[Month Year Sort],,DESC,Dense)

     

    Sort month1 on month Rank and use that in visual

     

    How to Create Sort Column and Solve Related Errors:
    https://www.youtube.com/watch?v=KK1zu4MBb-c