Forum Discussion

Schwurblini's avatar
Schwurblini
Frequent Visitor
3 years ago
Solved

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.
 

 

 
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
  • 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.

3 Replies

  • 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.
    • Schwurblini's avatar
      Schwurblini
      Frequent Visitor

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

  • hi  Schwurblini 

     

    try like:

     

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