Forum Discussion

Rana80's avatar
Rana80
Frequent Visitor
2 years ago
Solved

Datediff with filter from same column

I need to calculate the date difference between two dates in the same column. I cant seem to find an answer for this and would like to learn how to do this in PowerBi instead of excel.   The belo...
  • Ahmedx's avatar
    2 years ago

    and you can try this

    Diff3 = VAR _Top =
        TOPN(
            2,
            SUMMARIZE(
                'Table',
                'Table'[Task ID],
                'Table'[chat sequence],
                'Table'[Created On]
            ),
            'Table'[chat sequence], ASC
        )
    VAR _Result =
         MAXX( _Top, 'Table'[Created On] ) -
            MINX( _Top, 'Table'[Created On] )
    RETURN 
        FORMAT ( INT ( _Result ), "0:" ) & FORMAT ( _Result, "hh:mm:ss" )