Forum Discussion

Sudhavi_84's avatar
Sudhavi_84
Helper V
5 years ago
Solved

MM-DDDD Sorting Order in Column Visual

HI Experts, I have 4 different calculated Date columns based on criteria, Which I am using for 4 different Column Visuals. I want to sort Date Columns in to MM-YYYY Order in Column Visual (Horizont...
  • BA_Pete's avatar
    BA_Pete
    5 years ago

    Hi Sudhavi_84 ,

     

    Yes, the code I gave was for a new column in Power Query, as DAX calculated columns are not generally recommended.

    If you really need to do it in DAX, then the column formula would be:

    ..yearMonthSortKey = YEAR(yourTable[Date]) * 100 + MONTH(yourTable[Date])

     

    Pete