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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anithabs
Employee
Employee

CALCULATE(COUNTA(yourTable[Person]),ALLEXCEPT(yourTable,yourTable[Person]))

I need to understand how this will work can anyone explain this?

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anithabs ,

ALLEXCEPT means keep that filter. So in this all filter other than perosn will ignored. You will get person count by removing filter of all other than person.

If display by person. you will see 1. For most of the other groups it will be like sub total

 

refer these

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

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

 

View solution in original post

Jihwan_Kim
Super User
Super User

Hi, @Anithabs 

In my case, I try to create other measures that generate the same result.

I am not sure about how your whole data model looks like, but I created a sample pbix file like below.

And wrote two more measures that are easier to understand than allexcept (just my opinion).

 

Picture2.png

 

New Measure Allselect =
CALCULATE(COUNTA(yourTable[Person]),ALLSELECTED( yourTable[Category], yourTable[Subject]))
 
New Measure removefilters =
CALCULATE(COUNTA(yourTable[Person]),REMOVEFILTERS(yourTable[Category]), REMOVEFILTERS(yourTable[Subject]))
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @Anithabs 

In my case, I try to create other measures that generate the same result.

I am not sure about how your whole data model looks like, but I created a sample pbix file like below.

And wrote two more measures that are easier to understand than allexcept (just my opinion).

 

Picture2.png

 

New Measure Allselect =
CALCULATE(COUNTA(yourTable[Person]),ALLSELECTED( yourTable[Category], yourTable[Subject]))
 
New Measure removefilters =
CALCULATE(COUNTA(yourTable[Person]),REMOVEFILTERS(yourTable[Category]), REMOVEFILTERS(yourTable[Subject]))
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


amitchandak
Super User
Super User

@Anithabs ,

ALLEXCEPT means keep that filter. So in this all filter other than perosn will ignored. You will get person count by removing filter of all other than person.

If display by person. you will see 1. For most of the other groups it will be like sub total

 

refer these

https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/

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

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors