Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Mahipal
Helper I
Helper I

Converting from datatype Date/Time column to Date using DAX in Direct query

Hello Everyone,

We are using a column which is date/time datatype. Which we need to use to create date column using the DAX expression with calculated column in Direct Query

Joining date-   3/6/2021 4:18:56 PM 

We want out put to be just date column like 3/6/2021 (Date datatype).

Below is what we tried,

Column3 = COMBINEVALUES("/",MONTH(Employee[Joining date]),DAY(Employee[Joining date]),YEAR(Employee[Joining date])).
We are getting output as text value, but we need it as Date datatype because sorting is not working. 
Any suggestions to achieve this.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Mahipal ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table. Click on Transform Data.

vjiewumsft_0-1708926010635.png

2.Create the custom column to convert the Date/Time column to Date type.

= Text.From(Date.Month([Joining date]))&"/"&Text.From(Date.Day([Joining date]))&"/"&Text.From(Date.Year([Joining date]))

vjiewumsft_1-1708926048653.png

 

3.The Date type custom is shown below.

vjiewumsft_2-1708926114708.png

 

 

Solved: Change date format in DIRECT Query Mode - not on l... - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Mahipal ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table. Click on Transform Data.

vjiewumsft_0-1708926010635.png

2.Create the custom column to convert the Date/Time column to Date type.

= Text.From(Date.Month([Joining date]))&"/"&Text.From(Date.Day([Joining date]))&"/"&Text.From(Date.Year([Joining date]))

vjiewumsft_1-1708926048653.png

 

3.The Date type custom is shown below.

vjiewumsft_2-1708926114708.png

 

 

Solved: Change date format in DIRECT Query Mode - not on l... - Microsoft Fabric Community

 

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rajeshkumar12
New Member

is there any way of converting a text (2/3/2024) to date datatype in direct query mode

I don't seem to have problems with that?

 

item is a text type.

 

lbendlin_0-1707234429929.png

 

Mahipal
Helper I
Helper I

DATEVALUE(), REPT(),FORMAT() and few more functions are not working for Directquery mode.

 

lbendlin
Super User
Super User

Have you tried DATEVALUE() ?  Or DATE() ?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.