Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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.
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.
After using sort by column, the results of the ALL function start to look strange.
And, add the sort reference field to the ALL function as well, the result returned to normal.
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
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" ) )
)
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.
Schedule a short Teams meeting to discuss your question
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
10 | |
10 | |
9 | |
9 |
User | Count |
---|---|
20 | |
13 | |
12 | |
11 | |
8 |