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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

ALL function doesn't delete filter

Hello everyone!
I have very simple table 'Result' wich has columns Date_open, Date_close and Id.
I use two filters in dashboard: Date_open and Date_close
I want to create table with 2 columns:
1. Count Id with both filters: Date_close and Date_open
2. Count Id with one filters: Date_open

I have tried this code, which has to count id without filter on Date_close, but it doesn't work(( probably I don't understand ALL function correctly


CALCULATE (COUNT(result[id]), ALL(result[Date_close]))

 

1 ACCEPTED SOLUTION
daxer-almighty
Solution Sage
Solution Sage

NEVER use a single-table models. NEVER. They work counterintuitively and many a time will return wrong numbers without you even knowing it. Always use a proper star schema. ALWAYS.

 

Ignoring the above will result in you creating completely unreliable models that will calculate things you won't even be able to explain.

 

Understand star schema and the importance for Power BI - Power BI | Microsoft Docs

 

If you want to know what can happen if you don't follow the advice, here's an example: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Why-one-table-models-will-produce-WRONG-NUMBE...

 

View solution in original post

2 REPLIES 2
daxer-almighty
Solution Sage
Solution Sage

NEVER use a single-table models. NEVER. They work counterintuitively and many a time will return wrong numbers without you even knowing it. Always use a proper star schema. ALWAYS.

 

Ignoring the above will result in you creating completely unreliable models that will calculate things you won't even be able to explain.

 

Understand star schema and the importance for Power BI - Power BI | Microsoft Docs

 

If you want to know what can happen if you don't follow the advice, here's an example: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Why-one-table-models-will-produce-WRONG-NUMBE...

 

MattAllington
Community Champion
Community Champion

You shouldn't attempt these types of formulas without a Star Schema. Create lookup tables for both date columns and use those in your formulas and visuals. https://exceleratorbi.com.au/the-optimal-shape-for-power-pivot-data/



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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