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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
beanboy
Frequent Visitor

ALL function on a specific column not working like I think it should

Hi there,

 

I have a table of SalesData which contains mainly normal sales transactions but some Warranty sales as well. I flag if the sale is a warranty or not in the WarrantyY/N column. I generally want to exclude warranty sales so I have a filter on all pages where WarrantyY/N = "N". 

However, there are a few places where I still want to specifically show how many warranty sales there were, so I am looking for a measure to count the warranty sales transactions by ignoring the existing WarrantyY/N = "N" filter. 


Perhaps I am understanding the ALL function wrong, but my current understanding is the ALL function when used on a specific column strips all filters on that column. Below is what I thought would work. I've tried a few iterations with using FILTER but same results. The visual counts warranties correctly with no other filters are on the WarrrantyY/N column, but if I apply a filter to equal "N", the visual blanks out, i.e. not stripping the filters. Again, I though the ALL function would ignor this page level filter. 

 

 

#Sales_WARRANTIES = 
    CALCULATE ( 
        COUNT ( 'SalesData'[Date_Sale] ), 
        ALL ( 'SalesData'[WarrantyY/N] ),
        'SalesData'[WarrantyY/N] = "Y"
    )

 

I asked Copilot, and it also recommended the above solution.

There are some other page level filters, both from other columns in the SalesData table as wells as from related Dim tables if that makes a difference. 

2 REPLIES 2
xifeng_L
Super User
Super User

Hi @beanboy 

 

Did you apply sort by column to the WarrantyY/N field? If so, please add the sort reference field to the ALL function as well, for example:

 

ALL(WarrantyY/N, WarrantyY/N Index)

 

This is a side effect of the sort by column feature, which adds filtering of the sort reference field to the current context.

 

Here is a demonstration of that side effect:

 

Without using sort by columns, the ALL function gives the expected result.

 

xifeng_L_0-1717951985491.png

 

After using sort by column, the results of the ALL function start to look strange.

 

xifeng_L_1-1717952084111.png

 

And, add the sort reference field to the ALL function as well, the result returned to normal.

 

xifeng_L_2-1717952181332.png

 

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your filter context is created on the page, but please try something like below whether it suits your requirement.

 

#Sales_WARRANTIES =
CALCULATE (
    COUNT ( 'SalesData'[Date_Sale] ),
    KEEPFILTERS ( FILTER ( ALL ( 'SalesData' ), 'SalesData'[WarrantyY/N] = "Y" ) )
)


Microsoft MVP



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.




LinkedInVisit my LinkedIn page




Outlook BookingSchedule a short Teams meeting to discuss your question



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.