Forum Discussion
Sudhavi_84
5 years agoHelper V
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...
- 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
5 years agoHelper V
Is this something we need to write in Power Query (M Editor)? Not in new calculated column?
BA_Pete
5 years agoSuper User
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_845 years agoHelper V
Perfect Thank You