Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I have a Date column which is a String . I would like to generate a new column, that shows me the last n days. Therefore I need to convert my Column in a date
Im using this code:
Column_NewDate = FORMAT(PIVOT_TABLE[DATES];"DD.MM.YYYY")
I get a new column but as soon I create a new column for the last n days, i get a error msg.
Im using following code:
IF(DATEDIFF(PIVOT_TABLE[Column_NewDate ],TODAY(),DAY)>=7, "Yes", "No")
I get the Error Msg that I can not convert "23.10.2017" of Type "Text" into Date
I dont know what Iam doing wrong. Is it maybe because Iam using a View?
Solved! Go to Solution.
Use SUBSTITUTE to replace your "." with "/" before you try DATEVALUE.
Look at the DATEVALUE function. https://msdn.microsoft.com/en-us/query-bi/dax/datevalue-function-dax
I get the same Error Msg "You cant convert text to date"
I tried following Code:
Test = DATEVALUE(PIVOT_TABLE[DATES])
Maybe I should mention that my text date looks like this: DD.MM.YYYY
Use SUBSTITUTE to replace your "." with "/" before you try DATEVALUE.
Hi,
There could be one of 2 problems. Either . is not a recognised date seperator in your Windows Installation or if it is, then may be your systems date format in MM/DD/YYYY. It could also be both reasons.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 43 | |
| 39 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 67 | |
| 66 | |
| 31 | |
| 28 | |
| 24 |