cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Second opinion on my DAX Code plz. (COUNT DAX)

Hi everyone, 

 

I have a table that I'm trying to count if between two numbers. See the code below. The code is looking to count each row if a rate is greater than or equal to 4 and less than or equal to 5. 

 

However, what seems to be returning is, everything less than or equal to five, not inbetween. 

 

# of Employees at or below 5 = 
CALCULATE (
    COUNTROWS ( 'Current' ),
    FILTER ( 'Current', 'Current'[Rates] <= 4 >= 5 )
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Second opinion on my DAX Code plz. (COUNT DAX)

Hi @GradStudent2020 ,

 

Try this one:

 

CALCULATE (
COUNTROWS ( 'Current' ),
FILTER ( 'Current', 'Current'[Rates] >= 4  &&  'Current'[Rates] <= 5 )
)

 

Did I answer your question? Mark my post as a solution!
Ricardo


Did I answer your question? Mark my post as a solution!
Ricardo

View solution in original post

2 REPLIES 2
Highlighted
Community Champion
Community Champion

Re: Second opinion on my DAX Code plz. (COUNT DAX)

Hi @GradStudent2020 ,

 

Try this one:

 

CALCULATE (
COUNTROWS ( 'Current' ),
FILTER ( 'Current', 'Current'[Rates] >= 4  &&  'Current'[Rates] <= 5 )
)

 

Did I answer your question? Mark my post as a solution!
Ricardo


Did I answer your question? Mark my post as a solution!
Ricardo

View solution in original post

Highlighted

Re: Second opinion on my DAX Code plz. (COUNT DAX)

Thank you for the quick check!!!! Appreciate it, it worked. 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors