Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

average waiting time

How to calculate average waiting time where we have 1 column named attribute, which has anchroge and terminal and we have 1 entry date coumn now we need to calculate the waiting time between anchroge and terminal.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Here I create a sample to have a test.

    Measure:

    Avg Datediff =
    VAR _SUMMAIRZE =
        SUMMARIZE (
            'Table',
            'Table'[Category],
            "DateDiff",
                VAR _Anchroge =
                    CALCULATE ( MAX ( 'Table'[Entry Date] ), 'Table'[Attribute] = "Anchroge" )
                VAR _Terminal =
                    CALCULATE ( MAX ( 'Table'[Entry Date] ), 'Table'[Attribute] = "Terminal" )
                RETURN
                    DATEDIFF ( _Anchroge, _Terminal, DAY )
        )
    RETURN
        AVERAGEX ( _SUMMAIRZE, [DateDiff] )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Here I create a sample to have a test.

    Measure:

    Avg Datediff =
    VAR _SUMMAIRZE =
        SUMMARIZE (
            'Table',
            'Table'[Category],
            "DateDiff",
                VAR _Anchroge =
                    CALCULATE ( MAX ( 'Table'[Entry Date] ), 'Table'[Attribute] = "Anchroge" )
                VAR _Terminal =
                    CALCULATE ( MAX ( 'Table'[Entry Date] ), 'Table'[Attribute] = "Terminal" )
                RETURN
                    DATEDIFF ( _Anchroge, _Terminal, DAY )
        )
    RETURN
        AVERAGEX ( _SUMMAIRZE, [DateDiff] )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.