Forum Discussion

showy's avatar
showy
Helper II
1 year ago
Solved

Change sorting only in one visual visual calc

Hi i have a big report with some matrix. There the month are the colums. I sort them with a monthSort colum in the datedimesion. Jan = 1, Feb =2 , Mar = 3 .... Dez = 12 Everything is working fine....
  • pankajnamekar25's avatar
    1 year ago

    Hello showy 

    Create two new columns in your date table:

    MonthReverse = FORMAT('Date'[Date], "MMM")

    MonthSortReverse = 13 - 'Date'[MonthSort]  -- If Jan = 1, Feb = 2...

    Then in that specific matrix

    Use MonthReverse for the column headers.

    Sort MonthReverse by MonthSortReverse.

    Thanks,
     Pankaj Namekar | LinkedIn

    If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.

  • v-achippa's avatar
    1 year ago

    Hi showy,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Since the matrix ranges multiple years so just sorting by month may not work. Please follow below steps:

    • In your date table create a new column:
      YearMonth = FORMAT('Date'[Date], "MMM yyyy")
    • Then create a reverse sorting column:
      YearMonthSortReverse = 100000 - (YEAR('Date'[Date]) * 100 + MONTH('Date'[Date]))
    • In the matrix visual use YearMonth in the column headers and sort YearMonth by YearMonthSortReverse.

    This will sort the columns in reverse order for all months and years.

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

     

    Thanks and regards,

    Anjan Kumar Chippa