Forum Discussion
mork
Helper V
10 years agoGroup By month
Hello all, I have a table of my Resources work per week that I'm trying to group by month. How can I do that? Example table bellow. ResourceName Week# WeekSt...
Anonymous
10 years agoNot applicable
Hi mork,
I think you're searching this: monthYear = MONTH(table[WeekStartDate]) & "-" & YEAR(table[WeekStartDate]).
mork
Helper V
10 years agoAnonymous That should work but it doesn't. I get the same error.
What I'm doing is that in powerquery I select the "add column" tab and then I select "add custom column". A window pops up and I write the formula in the window. But the formula is in DAX language and not in M. Maybe that's the error? But I don't want to create a calculated column outside of powerquery because I want to group according to that column.
- Mi2n10 years ago
Microsoft Employee
Hi mork.. you can always look for the necessary M query formulas in the below link.
https://msdn.microsoft.com/en-us/library/mt211003.aspx
In your case, you would have to use the Date.Month() function.