Forum Discussion
NirH_at_BITeam
7 years agoFrequent Visitor
Convert DateTime into Date in Query Editor using M function
Hi, I'm looking for the right function to replace a DateTime to a Date in M. The challenge is that the DateTime length may vary based on month and day number, so for example I have: 8/5/2017 12:...
- 7 years ago
Hi,
This should help.
Anonymous
6 years agoNot applicable
Try wrapping the original DateTime data with the 'DateTime.Date()' function
Also, make sure the date you are referring to is actually a date and not a string
For example:
DateTime.Date(
Date.AddDays(
Date.StartOfMonth( DateTime.LocalNow())
,-1))
You may find this link on how to use the function useful
https://docs.microsoft.com/en-us/powerquery-m/datetime-date
Best,
Eric