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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Help with measure that counts rows ignoring a date slicer but also equal to a max date

Hello 

 

I am trying to create some visuals where my users will be able to compare the latest data to any point in time using a slicer.

 

I am trying to create a measure that filters to only count rows of my table that are equal to the MAX date in that table which I can do and looks like this:

 

Test = CALCULATE(COUNT(Data[Emp Count]),(filter(Dates,Dates[Date]=max(Data[Month]))))
 
This works as intended but I want to do is make it so it would be unaffected using a date slicer on my page which also uses a column from my Dates table.
 
Any help greatly appreciated.
 
thanks, 
1 ACCEPTED SOLUTION
kentyler
Solution Sage
Solution Sage

Try adding and ALL() filter to your CALCULATE statement. CALCULATE is the only function that can modify the filter context created by things like slicers.

Test = CALCULATE(COUNT(Data[Emp Count]),ALL(Data),(filter(Dates,Dates[Date]=max(Data[Month]))))

I learn something every time I answer a question

I'm a personal Power BI trainer 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


View solution in original post

1 REPLY 1
kentyler
Solution Sage
Solution Sage

Try adding and ALL() filter to your CALCULATE statement. CALCULATE is the only function that can modify the filter context created by things like slicers.

Test = CALCULATE(COUNT(Data[Emp Count]),ALL(Data),(filter(Dates,Dates[Date]=max(Data[Month]))))

I learn something every time I answer a question

I'm a personal Power BI trainer 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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
Top Kudoed Authors