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
Allie
New Member

Filter issue with "<="

Hello,

 

I am trying to get a chart that will show me Headcount progress over time. I found a video with a nice solution to that, but for some reason it does not work exactly how I want.

This is the formula:

Headcount = Calculate(COUNTROWS('[HR Actions] Actions in EC'), FILTER(values('[HR Actions] Actions in EC'[Hire Date]), '[HR Actions] Actions in EC'[Hire Date] <= MAX( Dates[Date])), filter(values('[HR Actions] Actions in EC'[Term Date]), OR('[HR Actions] Actions in EC'[Term Date] >= MIN(Dates[Date]), isblank('[HR Actions] Actions in EC'[Term Date] ) ) ) )
 
My issue is that instead of counting everyone filtered with Hire Date before or on a given Date, it only filters and counts people hired precisely on the given date, meaning the sign "<=" seems not to be working properly...
 
Any ideas what might be the problem??
1 ACCEPTED SOLUTION
Payeras_BI
Super User
Super User

Hi Allie,

 

Make sure the relationship between these two dates ([Hire Date] & [Term Date]) and the [Date] from your Calendar Table is inactive.

 

Regards,

 

J. Payeras

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

4 REPLIES 4
Payeras_BI
Super User
Super User

Hi Allie,

 

Make sure the relationship between these two dates ([Hire Date] & [Term Date]) and the [Date] from your Calendar Table is inactive.

 

Regards,

 

J. Payeras

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

Thank you 🙂

I was sure they were inactive, but went to check again and indeed relation to Hire Date was active for some reason...

Anonymous
Not applicable

Please, first learn about how to build correct models:

https://docs.microsoft.com/en-us/power-bi/guidance/star-schema

Then, try to learn about relationships in DAX:

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-relationships-understand

Then, try to learn about time-intelligence in DAX:

https://docs.microsoft.com/en-us/learn/modules/dax-power-bi-time-intelligence/

Then you'll be well equipped with knowledge to face issues like the one above.
themistoklis
Community Champion
Community Champion

@Allie 

 

Can you tell us more about your data model?

You use both Hire Date and Term Date in your formula

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