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
Kerry2701
Regular Visitor

Help with calculate and ALL and ALL SELECTED

Hi

I'm hoping someone can help me with the below, I've been stuck on this for far too long 🙂 

 

I need to provide a report on historical headcount and to filter this by location

I have tried to use the below formula with ALL and ALLSELECTED. All gives me the correct total but I am unable to filter, can anyone help me please? 

 

ALl Cons Headcount =
CALCULATE (
DISTINCTCOUNT('Current Assignments'[ID]),
FILTER (ALLSELECTED('Current Assignments'),
'Current Assignments'[Start Date]<= MAX ( 'Calendar'[DayMonthYear]) && 'Current Assignments'[End Date] >= Max ('Calendar'[DayMonthYear])))
 
Thanks
 
Kerry
3 REPLIES 3
amitchandak
Super User
Super User

ALl Cons Headcount =
CALCULATE (
DISTINCTCOUNT('Current Assignments'[ID]),
FILTER (('Current Assignments'),
'Current Assignments'[Start Date]<= MAX ( 'Calendar'[DayMonthYear]) && 'Current Assignments'[End Date] >= Max ('Calendar'[DayMonthYear])),all('Calendar'))

 

Try like the above or use crossfilter to remove date and assignment join

Thank you!
Unfortunately the amended formula above returned blank and I've tried the crossfilter option and I couldn't get that to work either, unless I've put it in the wrong place
The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

dax
Community Support
Community Support

Hi @Kerry2701 , 

I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data (by OneDrive for Business))? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.