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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Remove slicers in a calculate function

I have a table - Table1 with columns A, B, C,  and a measure [x] which uses a calculate function to count rows on this table, based on some conditions. I also have a second table - Table2, with columns X,Y,Z.

Now, I want to create another measure like this: 
CALCULATE (
      [x], 
      ALL(Table2),
      Table1[A] in VALUES(Table2[Z])
)


The point of ALL is to remove filters from Table2[Z], because I want these values not to be affected by the slicers. However, this query is not working and VALUES(Table2[Z]) is still being affected by the slicer!


1 ACCEPTED SOLUTION

@Anonymous Try:

CALCULATE (
      [x], 
      ALL(Table2),
      Table1[A] in ALL(Table2[Z])
)



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@Anonymous Try:

CALCULATE (
      [x], 
      ALL(Table2),
      Table1[A] in VALUES(ALL(Table2[Z]))
)



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler 
It gives an error: The VALUES function expects a column reference expression or a table reference expression for argument '1'

@Anonymous Try:

CALCULATE (
      [x], 
      ALL(Table2),
      Table1[A] in ALL(Table2[Z])
)



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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