Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jcastr02
Post Prodigy
Post Prodigy

Month Custom Column

How can I add a month name custom column within power Query?  I have a Complete date  column already loaded, but want a custom column in format "mmm-yy"

2 ACCEPTED SOLUTIONS
edhans
Community Champion
Community Champion

use this formula:

Text.Start(Date.MonthName([Date]), 3) & "-" & Text.End(Text.From(Date.Year([Date])), 2)

It returns this. You just need to set the column type to Text when done @jcastr02 

edhans_0-1611850917763.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

Jimmy801
Community Champion
Community Champion

Hello @jcastr02 

 

you can use the formula Date.ToText like this

Date.ToText([Date],"MMM-yy")

Here the complete example

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTVMzDUMzJQitWBcwyVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}, "de-DE"),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "MMM-yy", each Date.ToText([Date],"MMM-yy"))
in
    #"Added Custom"

Jimmy801_0-1611903296565.png

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

 

View solution in original post

2 REPLIES 2
Jimmy801
Community Champion
Community Champion

Hello @jcastr02 

 

you can use the formula Date.ToText like this

Date.ToText([Date],"MMM-yy")

Here the complete example

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjTVMzDUMzJQitWBcwyVYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}}, "de-DE"),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "MMM-yy", each Date.ToText([Date],"MMM-yy"))
in
    #"Added Custom"

Jimmy801_0-1611903296565.png

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

 

edhans
Community Champion
Community Champion

use this formula:

Text.Start(Date.MonthName([Date]), 3) & "-" & Text.End(Text.From(Date.Year([Date])), 2)

It returns this. You just need to set the column type to Text when done @jcastr02 

edhans_0-1611850917763.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.