Forum Discussion

PhoenixBird66's avatar
PhoenixBird66
Icon for Helper III rankHelper III
7 years ago
Solved

DAX to return the latest datetime value in from column

I'm trying to write a measure which will return the LATESTdatetime value of a field called [business duration], for each [dv_task].

 

So in the example below, for INC0344953 the measure would return 01/01/1970 00:18:04.

 

Any ideas?

 

  • dax's avatar
    dax
    7 years ago

    Hi PhoenixBird66,

    Yes, you could follow Ashish_Mathur’s  suggestions, or you could use below measure

    Measure 5 =
    CALCULATE (
        MAX ( maxtime[business_duration] ),
        ALLEXCEPT ( maxtime, maxtime[dv_task] )
    )

    Best Regards,

    Zoe Zhi

     

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

3 Replies

  • I'm trying to write a measure which will return the LATESTdatetime value of a field called [business duration], for each [dv_task].

     

    So in the example below, for INC0344953 the measure would return 01/01/1970 00:18:04.

     

    Any ideas?

     

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      Hi,

      Drag Dv_task to the row labels of the visual.  Write this measure

      =MAX(Data[business_duration])

      Hope this helps.

    • dax's avatar
      dax
      Icon for Community Support rankCommunity Support

      Hi PhoenixBird66,

      Yes, you could follow Ashish_Mathur’s  suggestions, or you could use below measure

      Measure 5 =
      CALCULATE (
          MAX ( maxtime[business_duration] ),
          ALLEXCEPT ( maxtime, maxtime[dv_task] )
      )

      Best Regards,

      Zoe Zhi

       

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