Forum Discussion

Raj_251891's avatar
Raj_251891
New Member
5 years ago

Table visualization/ display value based on max date

Hello, I am new to power BI and need you help on below:

 

I have the data as below:

alias_nodestMsg_codRef NoSrcstatusIDDate & Time
 WW-002PEES1001Wsuccess8121/9/2020 11:23:51 AM
 WW-003PEES1001Wsuccess8121/9/2020 11:23:53 AM
 WW-004PEES1001Wsuccess8121/9/2020 11:23:55 AM
 IW-001PEES1001Wsuccess8121/9/2020 11:23:49 AM
 TW-005PEES1001Wsuccess8121/9/2020 11:23:57 AM
 IW-006PEES1001Wsuccess8121/9/2020 11:24:00 AM
 ME-001PEES1001Esuccess8121/9/2020 11:23:39 AM
 EE-004PEES1001Esuccess8121/9/2020 11:23:41 AM
 ME-005PEES1001Esuccess8121/9/2020 11:23:43 AM
 IE-006PEES1001Esuccess8121/9/2020 11:23:45 AM
 WI-001PEES1001Isuccess8121/9/2020 11:23:47 AM
 MI-006PEES1001Csuccess8121/9/2020 11:24:02 AM

 

I am trying to create a table visualization to show the latest values based on the max date. Expected data as below:

Ref NoDate & TimeI-006Srcdeststatus
PEES100121/9/2020 11:24:02 AMI-006CM

success

 

Thanks
Raj 

4 Replies

  • Raj_251891 , All the columns other than Table[Date & Time], do this all column. Create a measure like this and use in Table visual

     

    Max Ref No= lastnonblankvalue(Table[Date & Time], max(Table[Ref No]))

  • Hey Raj_251891 ,

     

    make sure that the column Date & Time has the data type Date/Time assigned ,

    I changed the data type accordingly using Power Query:

    I chose the settings below:

    After that I created a calculated column using DAX (doing this, allows to filter the data using a slicer).

    I used this DAX statement:

     

    is latest = 
    var __currentDateTime = [Date & Time]
    var __maxDateTime = CALCULATE( MAX( 'Table'[Date & Time] ) , 'Table' )
    return
    IF( __currentDateTime = __maxDateTime  , 1 , 0 )

     

    Finally my table will look like this:

     

    Hopefully, this is what you are looking for.

     

    Regards,

    Tom

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Raj_251891 ,

    Here are the steps you can follow:

    1. Create Calculation Table.

    Table 3 = FILTER('Table',
    'Table'[Date & Time]=MAXX('Table','Table'[Date & Time]))

    2. Result.

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

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