This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I was trying to change the datetime format to date in the SQL statement in order to lessen the M query due to connecting to a huge database.
Here is my code: convert(date, createTime, 101), but turned out error. What is the appropriate command for it?
Solved! Go to Solution.
The createtime column is in datetime format.
Only the cast(createtime as date) works for me. The result is in the format of datetime too.
Is that possible to direct convert it to date format without using query M?
What is the datatype for your createTime column in SQL? Is it a Date-Time column or a character based data type (Char/NChar?)
you could try the following
CAST(createTime AS Date)
or
convert(date, createTime, 103)
or
TRY_CAST(createTime AS Date)
The createtime column is in datetime format.
Only the cast(createtime as date) works for me. The result is in the format of datetime too.
Is that possible to direct convert it to date format without using query M?
Date format is DateTime only set to midnight.
That's obvious and is clearly not the question.
You are aware that in M there's a data type Date that removes the Time component completely? So why when in SQL you explicitly CAST DateTime as DATE PowerQuery is not picking it up as Date data type but instead is treating it as DateTime with 00:00:00 in the time part? It looks ugly and is confusing.
Any updates on this or do I have to explicitly FIX every date column in Power BI? It's a complete pain when you've already specified it as a DATE data type in Microsoft SQL Server.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 21 |