MM-YY Format in M Date Code?

I’m working on a dashboard for a clinic that wants to see the month/year axis as
MM-YY vs MMM-YYYY as defaulted in the Month&Year column in the Extended date table.

Seems like this is a doable thing to add to the extended date table but since I have zero experience in creating M code and though I’ve been pondering the text in the extended table I’m a bit leery of trying to modify the code without a bit of guidance.

Thanks in advance for any guidance or tips before I go down the path of trial & error.

gina

Hi @gkavesh

Add a column with M code and apply the following formula

Date.ToText([Date],“MM-yy”)

Then use that column in report for the axis.
Important to use lower case “y”.

Cheers
Pete

1 Like

Great - thanks for the help.
I’ll go for it on a back up copy of my dashboard ‘just in case’

Hmm I must be missing something -
I’m getting an error when adding the column and my google search for the invalid identifier error isn’t helping much… I’m guessing is a minor miss on my part?
thanks

Stubbornness prevails! Figured it out - yes a very small nuance.
Should be:
Date.ToText([Date],“MMM yy”) aka there’s was a misplaced space in the copy/paste I did from your original post.

Thanks for the help!

1 Like