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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Second opinion on my DAX code, please. (COUNT DAX)

Hello everyone

I have a table that I'm trying to count if between two numbers. See the code below. The code looks 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 coming back is, anything less or equal to five, don't come in.

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

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

 

Hi @GradStudent2020 ,

 

Please check if this formula works.

 

 

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

 

 

Regards,

Harsh Nathani

 

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

View solution in original post

1 REPLY 1
harshnathani
Community Champion
Community Champion

 

Hi @GradStudent2020 ,

 

Please check if this formula works.

 

 

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

 

 

Regards,

Harsh Nathani

 

Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.