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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anithabs
Microsoft Employee
Microsoft 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...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
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...

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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