Forum Discussion
Strange error with Date.DayOfWeek function
- 6 years ago
Hi v-lid-msft ,
good news: My colleague changed the type from datetime to datetime2 in the MSSQL view. After this both operations worked as expected!
Regards,
Thomas
Hi tez ,
Because the workaround does not use second parameter of function, which seems casue the issue. What is the version of your power bi desktop, have you tried to reproduce with a blank pbix file which contain several rows of fake data?
The ToText function also works on my side, have you tried to use the DAX Format function to get the result (create a calculated column)?
Column = Format([Date],""ddd HH\h")
Update: we have no idea why your last reply comes into spam box, but if you require, we can restore it.
Best regards,
v-lid-msft thank you. I use Power BI Desktop Version: 2.80.5803.1061 64-bit (April 2020). I will try your recommendations today or tomorrow and get back to you. If I use a local copy of the table or an Excel file, the error is NOT reproducable, but I will do further testing.
- v-lid-msft6 years ago
Community Support
Hi tez ,
I guess the table is in DirectQuery Mode? so when custom column created, it transform into the native query and return error result. We think you may need to check the query received by the source, if table is in Directquery mode.
Best regards,- tez6 years ago
Resolver I