Forum Discussion

LarousseG's avatar
LarousseG
Regular Visitor
3 years ago
Solved

Merging client data within a set time period

  I have data from a machine we use for diagnosing issues with clients.   Each time we use the machine to do a sweep, we get a record of that sweep with the machine ID, ClientID, user ID, date, ti...
  • v-jialluo-msft's avatar
    3 years ago

    Hi LarousseG ,

     

    Please follow these steps:

    (1) Create a new measure

    COUNT = 
    SUMX (
        'Table',
        DIVIDE (
            1,
            CALCULATE (
                COUNTROWS (
                    FILTER (
                        ALL ( 'Table' ),
                        'Table'[User ID] = MAX ( 'Table'[User ID] )
                            && 'Table'[Sweep Date] = MAX ( 'Table'[Sweep Date] )
                            && ABS ( DATEDIFF ( 'Table'[Sweep Time], MAX ( 'Table'[Sweep Time] ), SECOND ) ) / 3600 < 2
                    )
                )
            )
        )
    )
    

     

    (2)Final output

     

     

    Best Regards,

    Gallen Luo

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