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
niko18033
Helper I
Helper I

Using ALL or ALLEXCEPT to calculate rate and ignore date, category filters

I need some assistance repairing my formula to calculate rate in a table which has two visual-level filters. I have a year's worth of data loaded into the dataset, but would like this table/graph to only display the latest 60 days. I also want to exclude 2 categories from the numerator ('Count'), but include them in the denominator ('Total Count'). Currently, I'm doing this exclusion through a visual-level filter in the left table in the below example.

Rate = DISTINCTCOUNT(Table[Field_ID]) 
/ 
CALCULATE(DISTINCTCOUNT(Table[Field_ID]), ALL(Table[Category]))

The formula is working fine, until I filter (or use relative date slicer) to the latest 60 days. How do I incorporate this within my formula to account for this? Do I need to add another condition for 'Day' in ALL or perhaps ALLEXCEPT?

 

In the example below, 'Rate' (left table) should equal 'Count' / 'Total Count' (from the right table). The first category with Count = 6351 and Total Count = 37839 should have Rate = 16.8%. However, the Rate is showing up as 35.5%.

 

When I remove the filter for latest 60 days, I get the proper rate of 16.8%. 

 

Any assistance in updating my formula would be much appreciated! Please let me know if you need me to provide any further details.

 

niko18033_1-1599595211490.png

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@niko18033 

Try Allselected() instead of ALL() for filtering.

 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@niko18033 

Try Allselected() instead of ALL() for filtering.

 

 

Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Greg_Deckler
Community Champion
Community Champion

@niko18033 Try using ALLEXCEPT instead of ALL. There is also KEEFILTERS and REMOVEFILTERS



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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