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.
Good Afternoon Community,
I monitor activity on a monthly basis. My Excel file does not have a column dedicated for month name. As I get more data each month, I will need to know the name of the month. Which is the better workflow, add this column in Excel, or in Power Query Editor?
Experimenting on my own, just to see what happens, I added a Custom Column in Power Query Editor:
D= Table.AddColumn(#"Changed Type", "Custom", each Date.MonthName) - results produce "Function" in each row.
Good afternoon I was very useful your solution, however, when I put the month in the table it organizes it in alphabetical order, and when I try to sort it by month number it does not appear as in its images.
I appreciate very much if you can help 🙂 me
hi @BillyRaygun - Another approach is to get the data into the model and then create a custom column in the data model
Also you would need to sort the new column using "Month Number" to view the months in the correct order
Please mark the post as a solution and provide a 👍 if my comment helped with solving your issue. Thanks!
Proud to be a Super User!
Hi @BillyRaygun
The part after the "each" is what goes into each row of the new column. You are entering Date.MonthName, which is a function
You need something like
D= Table.AddColumn(#"Changed Type", "Custom", each Date.MonthName([Date]))
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hey @BillyRaygun ,
you have to pass a date into the function, the function has 2 parameters, the 2nd is optional.
Something like this:
Date.MonthName([columnname])
Or something like this:
Date.MonthName(DateTime.LocalNow())
You have to be aware that the Power BI Service is returning UTC time by default.
Regards,
Tom
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 |
---|---|
115 | |
100 | |
88 | |
69 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |