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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

converting date in DAX

I have the date filed like this:

example:

01-01-2018 12:45:00

01-01-2018 12:12:00

01-01-2018 12:55:00

01-01-2018 12:18:00

01-01-2018 12:23:00

 

I want to change  the values to that hour :

 

01-01-2018 12:00:00

01-01-2018 12:00:00

01-01-2018 12:00:00

01-01-2018 12:00:00

01-01-2018 12:00:00

 

 

Can you please help.

Here I am not talking about rounding to the nearest hour

 

Thank you in advance

KKM

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

You can create a calcualted column below: 

 

Column = DATEVALUE('Table1'[DateTime]) &" "& TIME(HOUR('Table1'[DateTime]),0,0)
 
Then change the Data Type for this new column as Date/Time. 
 
q1.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
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

2 REPLIES 2
Anonymous
Not applicable

Hi

I would like to round down the date column  to the start of the hour in DAX.

 In the above example  data as you can see  the time part of the date has been converted to start of houer which is 12.

Can some one help please

kkmurthy

Hi @Anonymous,

 

You can create a calcualted column below: 

 

Column = DATEVALUE('Table1'[DateTime]) &" "& TIME(HOUR('Table1'[DateTime]),0,0)
 
Then change the Data Type for this new column as Date/Time. 
 
q1.PNG

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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