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
Schwurblini
Frequent Visitor

Filter between two values

Hi All

I am trying to count between two values, specifically i want to count all values between 5 and 10. I created the following measure:

 
More than 5 per month =
CALCULATE (
COUNT('Weekly Sales'[All Topnodes]),
FILTER('Weekly Sales', (COUNT('Weekly Sales'[All Topnodes]) >= 5 && 'Weekly Sales'[All Topnodes] < 10 )
))
 
The Topnodes are rows of a unique customer IDs which have an entry of that ID listed, every time this customer has a transaction. I want to know how many customers have made less than 5, between 5 and 10 and more than 10 transactions in a date slicer.
 Schwurblini_0-1671615009517.png

 

 
This Filter gives me no value back (For example 349997 should be returning 5), but when i only filter >= 5 or <10 i get all the values up to and from these settings.
Now i would only need the ones between obviously.
 
Where did i go wrong?
 
Thanks in advance for the help
1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

More than 5 per month =
CALCULATE (
COUNT('Weekly Sales'[All Topnodes]),
FILTER('Weekly Sales', (COUNT('Weekly Sales'[All Topnodes]) >= 5 && COUNT('Weekly Sales'[All Topnodes]) < 10 )
))

@Schwurblini I hope this post is helps.

View solution in original post

3 REPLIES 3
Mahesh0016
Super User
Super User

More than 5 per month =
CALCULATE (
COUNT('Weekly Sales'[All Topnodes]),
FILTER('Weekly Sales', (COUNT('Weekly Sales'[All Topnodes]) >= 5 && COUNT('Weekly Sales'[All Topnodes]) < 10 )
))

@Schwurblini I hope this post is helps.

Amazing thanks, i knew there was something i overlooked, thanks for the fast response.

FreemanZ
Super User
Super User

hi  @Schwurblini 

 

try like:

 

5To10Count :=
COUNTROWS(
    FILTER(
        TableName, 
        TableName[AllTopNodes]>=5
            &&TableName[AllTopNodes]<=10
    )
)

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.

Top Solution Authors