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
pedroccamaraDBI
Post Partisan
Post Partisan

DAX CALCULATE ALL SALES except year filter

Hello all. I hope everyone's ok
I don't know how to do this measure above, probably because i don't understand yet the concept or the rules.
I need to calculate [Net Sales] in this report but ignoring all filters except the year filter.
I've tried something like this but it's not working

All Sales = CALCULATE( [Net Sales], [Year Selected] = 'Tab Dates'[Year])
Can somebody help me? And it would be awesome with an explanation
Thanks a lot

Stay safe and healthy
Pedro
1 ACCEPTED SOLUTION
bcdobbs
Community Champion
Community Champion

Not 100% sure on your data model/tables etc but generally you want to do something like this:

All Sales = 
	CALCULATE( 
		[Net Sales],
		REMOVEFILTERS (),
		VALUES('Tab Dates'[Year])
	)

 

Removefilters without any parameters takes away all filters.

The values line then adds back in any existing filter on the year.

 

Have a read of this for more detail: Using ALLEXCEPT versus ALL and VALUES - SQLBI

 

(Note REMOVEFILTERS is the same as ALL it just makes the code easier to understand!)



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

2 REPLIES 2
bcdobbs
Community Champion
Community Champion

Not 100% sure on your data model/tables etc but generally you want to do something like this:

All Sales = 
	CALCULATE( 
		[Net Sales],
		REMOVEFILTERS (),
		VALUES('Tab Dates'[Year])
	)

 

Removefilters without any parameters takes away all filters.

The values line then adds back in any existing filter on the year.

 

Have a read of this for more detail: Using ALLEXCEPT versus ALL and VALUES - SQLBI

 

(Note REMOVEFILTERS is the same as ALL it just makes the code easier to understand!)



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Hello @bcdobbs 
It worked perfectly. And thanks a lot for the explanation. Awesome!!!
Stay safe my pbi friend😁

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.