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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
gagoush
Frequent Visitor

Except Function Usage

Hi,

 

I am trying to use Except Function get the minus between two tables.

 

Table 1 : User

Table 2 : CALCULATETABLE(User) Or ALL(User)

 

There is no relationship with these 2 tables. 

 

As the table User get filtered with certain criteria in the report, I am expecting the table EXCEPT(CALCULATETABLE(User),User) to give me the minus of Total Users - User(Filtered)... I also tried EXCEPT(All(User),User).. 

The question is : Does the Except function works with the context filter?

 

Thanks for your help!

 

Gary 

7 REPLIES 7
v-xjiin-msft
Solution Sage
Solution Sage

@gagoush

 

In your scenario, how did you filter the original User table?

 

Based on my test, it is able to use Except() function to get the minus of Total Users when using Page Level Filters. Please refer:

 

The source data is like:

 

111.PNG

 

Create a measure in Table All(User) to calculate the minus of Total Users: 

Measure = COUNTROWS(EXCEPT('All(User)',User))

Add a Page Level Filter, and the measure will return the minus of Total Users:

 

222.PNG

 

Thanks,
Xi Jin.

Thanks Xi it is working fine on my side too with the measure. 

 

However, I'd like to get the "minus" list of users and my first guess was to create a table ExceptedUsers = EXCEPT(ALL(User);User)

 

But this won't work. It is always empty.

 

How come?

 

Thanks for help again,

 

Gary

 

 

 

Got it.

 

I supose I need to load it twice?

 

Thanks,

@gagoush

 

No, I don't think load it twice will work.

 

The original data for the two tables are same, the filters (no matter what kind of filter in Power BI) will not change the original data in source table. It only affects the visual.

 

Thereby, the Except() function will not work for the two exactly same tables.

 

Thanks,
Xi Jin.

Do you have a workaround to see the list of users not having... ?

 

Thanks,

 

 

@gagoush

 

I'm afraid simply DAX expressions cannot achieve your requirement. But you can try to use Query Parameter to filter your table. Create two table visuals and one use euqals parameter to filter, one use does not equals.

 

Thanks,
Xi Jin.

@gagoush

 

You should know that the All(User) is a reference or a backup for the table User. When the context in table User is changed, the All(User) table will also be changed automatically. It also means, in fact the two tables are exactly the same.

 

And for the filters, it is used to filter the table for current page. It will not modify the table itself. Even the filter can modify the context of table User, the All(User) table will also be changed. 

 

So, in fact there's no EXCEPT between the two tables. That's why you cannot get any result from table ExceptedUsers = EXCEPT(ALL(User),User).

 

Thanks,
Xi Jin.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.