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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors