Forum Discussion
Date Fomat
I want custom column formula for changing date format 7/28/2023 9:10:02 AM to 2023-7-28 9:10:02 in poewrbi Desktop. How can I achieve this and the data is in Direct Query Mode.
- Anonymous3 years ago
Hi ompraashkumawat ,
As far as I know, calculated column by FORMAT function will return a column in text data type instead of date data type.
I suggest you to add a custom format in model view.
Select the column and change the format as below.
yyyy-mm-dd hh:mm:ss AM/PMResult is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
7 Replies
- AhmedxSuper User
plse try this
Column = FORMAT([Column1],"yyyy-mm-dd hh:mm:ss")- ompraashkumawatFrequent Visitor
I am getting this error. Is it due to Direct Query Mode?
- mlsx4Memorable Member
- ompraashkumawatFrequent Visitor
I am getting this error. Is it due to Direct Query Mode?
- AhmedxSuper User
probably yes!
- DhairyaSolution SupplierHey ompraashkumawat
Please try the below formula to create a calculated columnCalculatedColumn = FORMAT(YourTable[YourDateColumn], "yyyy-mm-dd hh:nn:ss AM/PM")
If this helps you then please mark my solution as accepted so that others can find it quickly on facing similar issues. Thank You!
- AnonymousNot applicable
Hi ompraashkumawat ,
As far as I know, calculated column by FORMAT function will return a column in text data type instead of date data type.
I suggest you to add a custom format in model view.
Select the column and change the format as below.
yyyy-mm-dd hh:mm:ss AM/PMResult is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.