Forum Discussion
change Format YYYYMM to MMM YY
- Anonymous2 years ago
Hi Afirmanu ,
Thank you AlienSx very much for the solution, and I've tried other ways to help you understand the problem:
For this problem of yours, I think the first step we have to define our data type, defining him as text type will help to help you out.
FormattedDate = VAR YearPart = LEFT([Posting Period], 4) VAR MonthPart = RIGHT([Posting Period], 2) VAR DateValue = DATE(VALUE(YearPart), VALUE(MonthPart), 1) RETURN FORMAT(DateValue, "MMM YY")This is the place where we have to sort the dates before we can realize the visual object you want.
This is because if you don't sort them, in the matrix, they will be sorted according to the size of the letters.
MonthSortOrder = SWITCH( LEFT([Posting Period], 6), "202401", 1, "202402", 2, "202403", 3, "202404", 4, BLANK() )Regarding the problem you are having with the super user suggestion,
I think you are not putting the super user code into the advance editor in the power query, you can try that.
Hope it helps!
Best regards,
Community Support Team_ Tom ShenIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.