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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Comparison between Date and Datetime type of data

I have a question that if I comapre a date to a datetime type, what actually is compared?

For example, I'm trying to sum up all values that in last 7 whole days(00:00 a.m. of the fisrt day to 24:00 p.m. of the 7th day).

I applied the filter "Table[DATETIME].[Date] >= TODAY() - 7", but the results seems not right.

Is this filter checks the date and time from the noon of the first day till the noon of the last day? Or it is only checked the date?

 

Thanks.

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

The filter "Table[DATETIME].[Date] >= TODAY() - 7" only check the date. If you need to check date and time meantime, you may set the data type of Table[DATETIME] as "Date/Time" .

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

The filter "Table[DATETIME].[Date] >= TODAY() - 7" only check the date. If you need to check date and time meantime, you may set the data type of Table[DATETIME] as "Date/Time" .

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

amitchandak
Super User
Super User

@Anonymous , seem fine, better you create a date column and use that

 

new date = Table[DATETIME].Date

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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