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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Fusilier2
Helper V
Helper V

Help with DAX measure - Count values if > than

Hi,

Struggling with a DAX measure. Hope somebody can help?

I have a table listing employees and the number of days sickness thay have had in a particular month.

I'm trying to create a measure to count the number of instances where sickness days were greater than 27..

So far I have got this measure:

Number of LTS Incidents = COUNT(Sickness[Calendar Days])>27
Which is giving the answer True. instead of a number.
Can anybody advise me where I am going wrong please? I'm sure this is a pretty simple DAX calculation, I just can't work it out!
 
Thanks in advance.

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

@Anonymous  Thanks for your contribution on this thread.

Hi @Fusilier2 ,

@Anonymous has provide the solution, please check if it can return your expected result.

Measure = CALCULATE(DISTINCTCOUNT('Table'[Employee No]),'Table'[Calendar Days]>27)

vyiruanmsft_0-1713945818686.png

Best Regards

View solution in original post

Anonymous
Not applicable

calculate(sum(calendar days), calendar days > 27)

View solution in original post

9 REPLIES 9
Fusilier2
Helper V
Helper V

Thank you so much, your help is really appreciated. 

I was part way there! Much to learn in DAX...

Anonymous
Not applicable

Much to learn, keep going!

Fusilier2
Helper V
Helper V

Here's some sample data:

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

The measure should be returning the value 4

Anonymous
Not applicable

calculate(distinctcount(employer No), calendar days > 27)

Anonymous
Not applicable

That's because your measure is asking if the count of sickness days is greater than 27, not counting the number of instances that the number of days was over 27. 

If you can show a sample of data with no sensitive information, that'd help

Thanks. I've uploaded some sample data above.

Anonymous
Not applicable

@Anonymous  Thanks for your contribution on this thread.

Hi @Fusilier2 ,

@Anonymous has provide the solution, please check if it can return your expected result.

Measure = CALCULATE(DISTINCTCOUNT('Table'[Employee No]),'Table'[Calendar Days]>27)

vyiruanmsft_0-1713945818686.png

Best Regards

That worked. Thank you.

How would I change the DAX expression to sum all the calendar days greater than 27 instead of count the instances?

Anonymous
Not applicable

calculate(sum(calendar days), calendar days > 27)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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