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
Anonymous
Not applicable

ALL() leads to wrong calculations

Hello all,

I am experiencing some problems with the ALL() function

In a few words, I am want to display the total sales + market shares for a few item from field 1. 
- To do so, I am filtering my table to display only the wanted items.
- Also, in the DAX formula for my Market Share, I used the ALL() function for the denominator to take into account all the items in field 1, and not only the one filtered. Here it is
Denominator =  CALCULATE ( SUM ( TABLE[Sales] ), ALL ( TABLE[field 1] ) )


=> However, I noticed that this calculation is lower than it should be, as if Power BI was not taking into account all the lines in my table. 
=> Randomly, I added an item in my table (which accounts for a large number of lines in my TABLE). Then the calculation was correct as if this forced Power BI to take into account all the lines in my TABLE when calculating.

I looked through the Microsoft documentation (https://docs.microsoft.com/fr-fr/dax/all-function-dax), it did not help since it does not seem to be a problem of "Dax auto-exist' (https://www.sqlbi.com/articles/understanding-dax-auto-exist/).

Many thanks for your help !!


5 REPLIES 5
plainly
Regular Visitor

Hello,

 

I typically approach this type of challenges making things as simple as possible. Make a new data model where you have only the table in question, and add there exactly only this one measure without any filters. 

 

Filtering in DAX is slightly tricky, and testing if something works with a filter is likely not the first step to test if all values all returned. For example the following deliver the same result no matter how you filter with Power BI report filters product table.

  • The KEEPFILTER function does not override the existing set of filters. Instead, it uses the intersection of values present in
KEEPFILTERS(FILTER(ALL(product[column] ); product[column] > 10)  
= FILTER(product;product[column] > 10)
= KEEPFILTERS(product[column] > 10)

 

However:

  • The FILTER function overrides any existing set of filters on a column applied via slicers. So now if you filter by product table values will not change.
CALCULATE([measure];product[column] > 10)
= CALCULATE([measure];FILTER(ALL(product[column]);product[column] > 10))

 

See more interesting content on my Blog: https://www.plainlyresults.com/tag/dax/

 

 

 

Anonymous
Not applicable

Hello @plainly  and thanks for participating.
Unfortunately, your comment does not help. My problem here is not a matter of filtering but a bug issue linked with the use of ALL() function. 

FYI, I have attempted to use the REMOVEFILTERS() function but it does not solve it.

 

CNENFRNL
Community Champion
Community Champion

@Anonymous , your measure

Denominator =  CALCULATE ( SUM ( TABLE[Sales] ), ALL ( TABLE[field 1] ) )

only assures nothing but filters on TABLE[field 1] are removed; any other filters on other columns still affect calculation of SUM(TABLE[Sales]).


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

By the way, I have understood that any other filters than TABLE[field1] are active. It is the purpose of ALL() function.
Anyway, this sum() does not give the right number... Power BI is facing a "bug": the result of such sum() evolves when I change the selection filtered on TABLE[field1]. It should not be the case due to the use of ALL() function

 

Anonymous
Not applicable

Thank your for your answer and your help @CNENFRNL !

You are right, but this is not a matter of filtering. Proof is the calculation becomes true when I randomly add an item in my filtered selection. I think this is due to a Power BI optimization bug linked with the use of ALL() function ...



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.