Forum Discussion

olimilo's avatar
olimilo
Post Prodigy
2 years ago
Solved

Get date from datetime column, source is live connection

I'm trying to compare the current date against a column that is formatted as a datetime column in the source PBI dataset. I've re-set the Format from a datetime format to just yyyy-MM-dd in the report:

 

 

Since none of the sample data are equivalent to the current date, I just used a dummy date (Aug 27) to check if it works:

'Project'[X_DATE_CLOSED] = DATEVALUE("2024-08-27")

 

However, I am not getting the correct result which I assume is because of X_DATE_CLOSED being a datetime column:

 

Is there a way I can get only the date part of a datetime value? FORMAT() doesn't work in this case since it is a live connection.

 

  • Using DATEVALUE() on the datetime column seems to have gotten me the correct output.

     

    Column = DATEVALUE('Project'[X_DATE_CLOSED]) = DATEVALUE("2024-08-27")

     

     

     

     

1 Reply

  • olimilo's avatar
    olimilo
    Post Prodigy

    Using DATEVALUE() on the datetime column seems to have gotten me the correct output.

     

    Column = DATEVALUE('Project'[X_DATE_CLOSED]) = DATEVALUE("2024-08-27")