Forum Discussion
Sudhavi_84
Helper V
5 years agoMM-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...
- 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
Sudhavi_84
Helper V
5 years agoIs this something we need to write in Power Query (M Editor)? Not in new calculated column?
BA_Pete
Super User
5 years agoHi 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
- Sudhavi_845 years ago
Helper V
Perfect Thank You