Forum Discussion

MatheusRuiz's avatar
MatheusRuiz
Frequent Visitor
4 years ago
Solved

How to get the latest record for each Key?

Hello, everyone. Hope someone can help me on that.   This is my example table:   I want to create a table visualization that shows only the last record for each Vehicle, and only if in this...
  • rsbin's avatar
    rsbin
    4 years ago

    MatheusRuiz ,

    Apologies for misunderstanding your original post.
    I'm hoping this New Table will work for you:

    LastArrivalTable = SUMMARIZE(
                            FILTER( Vehicle,
                                    Vehicle[Date]
                                    = CALCULATE (MAX ( Vehicle[Date] ),
                                       ALLEXCEPT ( Vehicle, Vehicle[Vehicle] ))),
                        Vehicle[Vehicle],
                        Vehicle[Date],
                        Vehicle[Location],
                        Vehicle[Type] )

    This table will give you both ARRIVING and LEAVING.  You can use the Filter Pane to filter out LEAVING.  Pretty sure there should be a way to add this filter into the formula above, I just wasn't able to figure it out before I had to move on to some other work.

    Best Regards,