cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
krasniqi123
New Member

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

@krasniqi123 Try:

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


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@krasniqi123 Try:

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


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

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

@krasniqi123 Try:

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


@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors