Forum Discussion
Anonymous
4 years agoNot applicable
Date to YYYYMM format with DirectQuery
Hi, I have a Date column (dd-mm-yyyy) that I would like to transform into yyyymm. My table is connected via DirectQuery. I used the following m-query for the transformation: Number.ToText(Date.Ye...
- 4 years ago
You can use Date.ToText to create a custom column like this:
Date.ToText([Date], [Format="yyyyMM"]))This doesn't work with DirectQuery though.
For DirectQuery, try this:
100 * Date.Year([Date]) + Date.Month([Date])You can either keep this as an integer or convert it to text.
AlexisOlson
4 years agoSuper User
You can use Date.ToText to create a custom column like this:
Date.ToText([Date], [Format="yyyyMM"]))
This doesn't work with DirectQuery though.
For DirectQuery, try this:
100 * Date.Year([Date]) + Date.Month([Date])
You can either keep this as an integer or convert it to text.
Anonymous
4 years agoNot applicable
Thank you very much, this works!