Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi All,
i need to know, how Transform date into month and year format in excel query
Solved! Go to Solution.
@Anonymous Do you want seperate column for Month and Year in your data, you can do this using below lines in power query
#"Inserted Month Name" = Table.AddColumn(#"Changed Type", "Month Name", each Date.MonthName([Date]), type text),
#"Inserted Year" = Table.AddColumn(#"Inserted Month Name", "Year", each Date.Year([Date]), Int64.Type)
Your output will be like below
Proud to be a Super User!
@Anonymous Do you want seperate column for Month and Year in your data, you can do this using below lines in power query
#"Inserted Month Name" = Table.AddColumn(#"Changed Type", "Month Name", each Date.MonthName([Date]), type text),
#"Inserted Year" = Table.AddColumn(#"Inserted Month Name", "Year", each Date.Year([Date]), Int64.Type)
Your output will be like below
Proud to be a Super User!
@Anonymous
Instead of creating those columns in Power Query, do it in the Data Model.
Go to your table, add a new column for Year Month Sorting:
YearMonthSort = YEAR([DATE]) * 100 + MONTH([DATE])
Add the Year Month column to use in visuals
Year Month = FORMAT([DATE],"MMM YYYY")
Now select the Year Month Column and got the Column Tools tab and sort by YearMonthSort column, Done
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
54 | |
21 | |
12 | |
11 |