Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

IF Value > 0

Hi,    I have the following table, I would like to get the distinct count as a query for TrackerID but when the durationconnected is greater than zero, then pick the TrackerID value for DurationCon...
  • v-juanli-msft's avatar
    7 years ago

    Hi Anonymous

    You could use DAX to change the data model.

    Create a new table

    Table =
    FILTER (
        SUMMARIZE (
            ALL ( Sheet2 ),
            [duration],
            [id],
            "rank"RANKX (
                FILTER ( ALL ( Sheet2 ), [id] = EARLIER ( Sheet2[id] ) ),
                [duration],
                ,
                DESC,
                DENSE
            )
        ),
        [rank] = 1
    )

     

    Best Reagrds

    Maggie