Forum Discussion

topazz11's avatar
topazz11
Helper III
6 years ago
Solved

Date conversion

Hello,   I need help a DAX to get maximum (latest) date as below?  There are multiple timestamps on the same date and I need to get a max date from the same date timestamps. Thank you!  
  • Greg_Deckler's avatar
    6 years ago

    Try:

     

    Column =
    VAR __Date = INT([Column1])
    RETURN
    DATE(YEAR(__Date),MONTH(__Date),DAY(__Date))
     
    Set the display to just the date and not date and time.

     

  • v-chuncz-msft's avatar
    6 years ago

    topazz11 

     

    You may use the following DAX to add a calculated column.

    Column =
    VAR d = Table1[Timestamp].[Date]
    RETURN
        IF (
            RANKX (
                FILTER ( Table1, Table1[Timestamp].[Date] = d ),
                Table1[Timestamp],
                ,
                DESC
            ) = 1,
            Table1[Timestamp]
        )