Select the last record from a related table

Get the last record from a related table with Dax in Power BI.
Patriek
26 augustus 2022:

The following dax query will get you the last record from a related table.

_number_call_waiting_last_record_in_days =
MAXX (
    TOPN (
        1,
        FILTER (
            IncidentDurationBlocks,
            IncidentDurationBlocks[incidentid] = incidents[id]
        ),
        IncidentDurationBlocks[end], DESC
    ),
    IncidentDurationBlocks[duration_inSeconds]
)
    I like to see who's visiting my website, do you accept?
    Do you want to accept tracking cookies?