Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello all,
The data came 07/20/2020 and I changed it to 202007 and I would like it to be shown as July 2020, any thoughts?
Solved! Go to Solution.
In Power Query (where you posted this) you would use this formula in a new column:
= Date.MonthName([Date]) & " " & Text.From(Date.Year([Date]))
If you are using DAX and want a calculated column (not recommended), you could use this:
DAX Date Text = FORMAT([Date], "MMMM YYYY")
In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI Reporting
seems even if I have not found where it is documented, that to have in the name of the month you have to use capital M.
MMM (3) for short name MMMM (4) for full name
Table.AddColumn(PreviousStep, "Next Gate Date 1", each Date.ToText([Next Gate Date], "MMM/yyyy"))
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
If you want to create a calculated column, you may try the following dax.
Column = FORMAT('Table'[Next Gate Date],"mmmm yyyy")
If you want to create a custom column in 'Query Editor', you may go to 'Query Editor'=>'Add Columns' ribbon=>'Custom Column', input the following codes.
Custom = Date.ToText([Next Gate Date],"MMMM yyyy")
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
If you want to create a calculated column, you may try the following dax.
Column = FORMAT('Table'[Next Gate Date],"mmmm yyyy")
If you want to create a custom column in 'Query Editor', you may go to 'Query Editor'=>'Add Columns' ribbon=>'Custom Column', input the following codes.
Custom = Date.ToText([Next Gate Date],"MMMM yyyy")
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Table.AddColumn(PreviousStep, "Next Gate Date 1", each Date.ToText([Next Gate Date], "yyyyMM"))
seems even if I have not found where it is documented, that to have in the name of the month you have to use capital M.
MMM (3) for short name MMMM (4) for full name
Table.AddColumn(PreviousStep, "Next Gate Date 1", each Date.ToText([Next Gate Date], "MMM/yyyy"))
Lowercase M means minutes
@Anonymous
Power Query:
Date.ToText([NextGateDate], "yyyyMM")
@Anonymous - List of FORMATS can be found here. Shouldn't be a need for that though, there is a default pre-defined format for that:
In Power Query (where you posted this) you would use this formula in a new column:
= Date.MonthName([Date]) & " " & Text.From(Date.Year([Date]))
If you are using DAX and want a calculated column (not recommended), you could use this:
DAX Date Text = FORMAT([Date], "MMMM YYYY")
In general, try to avoid calculated columns. There are times to use them, but it is rare. Getting data out of the source system, creating columns in Power Query, or DAX Measures are usually preferred to calculated columns. See these references:
Calculated Columns vs Measures in DAX
Calculated Columns and Measures in DAX
Storage differences between calculated columns and calculated tables
Creating a Dynamic Date Table in Power Query
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.