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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

how to filter a measure using allexcept in category

Hi, i am new with power BI and i am wondering how to create a measure using a filter on another measure, but using allexcept. The goal is for example to have all the sports sales except for hockey and basket, 

Thank you

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Whoops, had my NOT in the wrong spot.

Sales excl 2 = CALCULATE ( SUM ( 'table'[Sales Amount] ), NOT 'table'[Sport] IN {"hockey","basketball"} )

View solution in original post

6 REPLIES 6
jdbuchanan71
Super User
Super User

Whoops, had my NOT in the wrong spot.

Sales excl 2 = CALCULATE ( SUM ( 'table'[Sales Amount] ), NOT 'table'[Sport] IN {"hockey","basketball"} )
Anonymous
Not applicable

It works, thanks a lot!

jdbuchanan71
Super User
Super User

No, that would be this.

Sales 2 = CALCULATE ( SUM ( 'table'[Sales Amount] ), 'table'[Sport] IN {"hockey","basketball"} )
jdbuchanan71
Super User
Super User

That is not really what ALLEXCEPT is for.  To do what you are describing would be along these lines.

Sales excl 2 = CALCULATE ( SUM ( 'table'[Sales Amount] ), 'table'[Sport] NOT IN {"hockey","basketball"} )
Anonymous
Not applicable

When i write, it highlights the word NOT in red saying it's an unexpected expression?

Anonymous
Not applicable

ok, and i guess if i want to create the same type of mesure except this time by filtering the sales for hockey AND basket, i just have to write :

CALCULATE ( SUM ( 'table'[Sales Amount] ), 'table'[Sport] IN {"hockey"}, 'table'[Sport] IN {"basketball"} )

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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