Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Find most recent date

Hi all,

I am looking for a solution to calculate the most recent_ready_date if the LOCATION and the PARTNUMBER_SUP is the same

In the last column I mentioned the outcome of the calculation.

Thanks for your help!

John

 

locationready_datpartnumber_supmost_recent_ready_date
City12/28/2021AM17108120112/28/2021
City9/23/2021AM17108120112/28/2021
Holland11/12/2021120039501SV11/12/2021
Holland7/20/2021120039501SV11/12/2021
America12/27/2021AM17108120112/27/2021
America6/3/2021AM17108120112/27/2021

 

  • Anonymous , Try a new column like

     

    maxx(filter(Table, [location] = earlier([location]) && [PARTNUMBER_SUP] = earlier([PARTNUMBER_SUP])), [ready_dat])

     

    a nw measure like

     

    maxx(filter(allselected(Table), table[location] = max(table[location]) && table[PARTNUMBER_SUP] = max(table[PARTNUMBER_SUP])), table[ready_dat])

  •  

    most recent ready date: =
    IF (
    ISINSCOPE ( Data[location] ),
    IF ( COUNTROWS ( Data ) > 1, MAX ( Data[ready_dat] ) )
    )

2 Replies

  • Anonymous , Try a new column like

     

    maxx(filter(Table, [location] = earlier([location]) && [PARTNUMBER_SUP] = earlier([PARTNUMBER_SUP])), [ready_dat])

     

    a nw measure like

     

    maxx(filter(allselected(Table), table[location] = max(table[location]) && table[PARTNUMBER_SUP] = max(table[PARTNUMBER_SUP])), table[ready_dat])

  •  

    most recent ready date: =
    IF (
    ISINSCOPE ( Data[location] ),
    IF ( COUNTROWS ( Data ) > 1, MAX ( Data[ready_dat] ) )
    )