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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Icad
Frequent Visitor

Many REMOVEFILTERS. Is there a shorter way?

Hello DAX experts,

That is my first question here 🙂

 

I have a measure with many REMOVEFILTERS:

Store Vals = 

CALCULATE(SUM(pbiFact[Sale]),
  REMOVEFILTERS('pbiDepartments'[Department]),
  REMOVEFILTERS('pbiSubCategories'[SubCategory]),
  REMOVEFILTERS('pbiCategories'[Category]),
  REMOVEFILTERS('pbiProducts'[Product])
)

 

That I use in another measure:

% of Stores Vals =
DIVIDE( [Vals],
  CALCULATE ( [Store Vals] ) ,
  BLANK()
)
 
Is there a shorter way to write the first measure?
Thanks. Icad.
1 ACCEPTED SOLUTION
vanessafvg
Community Champion
Community Champion

you can then use allexcept()

 

https://docs.microsoft.com/en-us/dax/allexcept-function-dax





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
vanessafvg
Community Champion
Community Champion

can i first ask what you actually trying to end up with.  Are you just wanting to sum the value filter free?  ie you want all to divide into?

 

I think what you looking to do is use the all function.

% of Stores Vals =
DIVIDE (
    [Vals],
    CALCULATE ( SUM ( pbiFact[Sale] )ALL ( [pbiFact] ) ),
    BLANK ()
)

 

this video might help.  

https://www.youtube.com/watch?v=AIk1vPM-u2I

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Vanessa, thanks for your fast answer.

ALL remove all filters. I need to keep filters (Year,..., YTD)

and just remove Hierarchy filters (like Dept, Cat, SubCat, Product).

I thought there is something like:

CALCULATE ( SUM ( pbiFact[Sale] ),  keep row context and all dates filters except hierarchy filters )

Thanks. Icad.

Hi @Icad ,

As vanessafvg suggests, you could try the function of ALLEXCEPT. Here are the blogs that you could reference to learn more.

REMOVEFILTERS() in DAX 

https://www.sqlbi.com/articles/managing-all-functions-in-dax-all-allselected-allnoblankrow-allexcept... 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

CST, thank you for your help 🙂

I'll try again later and post here. Icad.

vanessafvg
Community Champion
Community Champion

you can then use allexcept()

 

https://docs.microsoft.com/en-us/dax/allexcept-function-dax





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Vanessa, sorry for the delay (bad times).

ALLEXCEPT doesn't work for me, maybe because I'm too tired.

I'll try again later and let you know.

Thanks again for your valuable time. Icad

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.