Forum Discussion

DataIsMyMN's avatar
DataIsMyMN
Frequent Visitor
3 years ago
Solved

Latest & Earliest Date/Time Function Not Reporting Correctly

I have data that shows the date and time for file reciept; I am trying to create cards that show what the EARLIEST file receipt time was and what the LATEST file receipt time was in the given set of ...
  • Greg_Deckler's avatar
    Greg_Deckler
    3 years ago

    DataIsMyMN Oh, you want the items with the min or max time regardless of date. If that is the case see attached PBIX below signature.

    Earliest = 
        VAR __Table = 
            ADDCOLUMNS(
                'Table',
                "Time", [Last File Receipt Time] - TRUNC([Last File Receipt Time])
            )
        VAR __MinTime = MINX(__Table, [Time])
        VAR __Result = MINX(FILTER(__Table, [Time] = __MinTime),[Last File Receipt Time])
    RETURN
        __Result
    Latest = 
        VAR __Table = 
            ADDCOLUMNS(
                'Table',
                "Time", [Last File Receipt Time] - TRUNC([Last File Receipt Time])
            )
        VAR __MaxTime = MAXX(__Table, [Time])
        VAR __Result = MINX(FILTER(__Table, [Time] = __MaxTime),[Last File Receipt Time])
    RETURN
        __Result