Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

count rows under filter and date slicer

How to count rows only if the id appears more than 3 times under a date slicer?

It would be like calculate(count(id), (count(id)>3),date<max(date),date>min(date))

  • Hello Anonymous 

    It will look something like this:

     

     

    IDs > 3 =
    COUNTX (
        FILTER (
            VALUES ( YourTable[ID] ),
            CALCULATE ( COUNTROWS ( YourTable ) ) > 3
        ),
        0
    )

     

    We are generating the list of ID's then filtering that list based on the count being > 3 then counting the remaining list.  The date slicer is applied as a filter to the measure without needing to be included in the measure.

     

    If this solves your issues please mark it as the solution. Kudos 👍 are nice too.

2 Replies

  • Hello Anonymous 

    It will look something like this:

     

     

    IDs > 3 =
    COUNTX (
        FILTER (
            VALUES ( YourTable[ID] ),
            CALCULATE ( COUNTROWS ( YourTable ) ) > 3
        ),
        0
    )

     

    We are generating the list of ID's then filtering that list based on the count being > 3 then counting the remaining list.  The date slicer is applied as a filter to the measure without needing to be included in the measure.

     

    If this solves your issues please mark it as the solution. Kudos 👍 are nice too.

    • Anonymous's avatar
      Anonymous
      Not applicable

      It works! Thanks you so much!