Forum Discussion
Previous month name in a empty table
- 7 years ago
Finally I found something that works :
PrevMon = FORMAT(EDATE(NOW();-1);"MMMM")
:smileyhappy:
Thanks everyone !
Both method interest me but maybe I should say : the most simple one :)
ohb60 Please try this to get the previous month name
Power Query Editor (M-Code)
= Table.AddColumn(#"Added Custom", "PrevMonth", each Date.MonthName(Date.AddMonths([hiredate],-1)))
DAX
PrevMon = FORMAT(EDATE(emp[hiredate],-1),"MMMM")
- ohb607 years agoFrequent Visitor
PattemManohar wrote:ohb60 Please try this to get the previous month name
Power Query Editor (M-Code)
= Table.AddColumn(#"Added Custom", "PrevMonth", each Date.MonthName(Date.AddMonths([hiredate],-1)))
DAX
PrevMon = FORMAT(EDATE(emp[hiredate],-1),"MMMM")
Thank you for this but I can't make it work either :
I wrote this in my new measure :
PrevMon = FORMAT(EDATE(MAJ[Update];-1);"MMMM")
I got this error message :
It is not possible to determine a single value for the 'Update' column of the 'Update' table. This can occur when a measurement formula refers to a column that contains many values, without specifying an aggregation such as min, max, count, or sum to obtain a single result.
Here's the code I have in my 'Update' column :
let Source = Table.FromRows({{DateTime.LocalNow()}},{"Update"}) in Source- ohb607 years agoFrequent Visitor
Finally I found something that works :
PrevMon = FORMAT(EDATE(NOW();-1);"MMMM")
:smileyhappy:
Thanks everyone !