Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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))

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

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.

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

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
Not applicable

It works! Thanks you so much!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.