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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Bilal0336
Frequent Visitor

How to use FILTER with ALL?

I have a CALENDER table with LASTDAY column. On the page level I have applied filter:
CALENDER[LASTDAY] is on or after 1/1/2021

I have a slicer on the page having all the months. What I want to do is to compare ALLSELECTED(CALENDER[LASTDAY]) with ALL(CALENDER[LASTDAY]). But for the ALL(CALENDER[LASTDAY]) it is also neglecting Page Level filter values and considering all the values. So in that case, how can I use ALL and FILTER together?

 

What I want is: ALL should consider Page Level Filter because I need all values that are on or after 1/1/2021...  Please guide, I used this:


_DefaultALL =
COUNTX(FILTER(ALL(CALENDAR_DIM[LASTDAY]), CALENDAR_DIM[LASTDAY] >= 1/1/2022), CALENDAR_DIM[LASTDAY])

But it is not applying this CALENDAR_DIM[LASTDAY] >= 1/1/2022 to ALL(CALENDAR_DIM[LASTDAY]).

Thanks
@amitchandak @lbendlin 
1 ACCEPTED SOLUTION

The format of your lastday column is incorrect. Should say 

>= "2022-01-01"

View solution in original post

6 REPLIES 6
bcdobbs
Community Champion
Community Champion

I think you might possibly be misunderstanding ALLSELECTED. It bring back the filter context as it was at the creation of a visual (for example all the rows in the matrix rather than the current row).

 

ALLSELECTED effectively then gives you the values selected by any slicers/page filters. No way to separate where they came from.

 

ALL removes all filters including page filters.

 

Sure we can find a way round but it's not easy.

Are the page filters static? If so you could manually add them back into filter context.

 

Alternative approach would be to use a disconnect table to drive the slicer and then pass the filter in DAX using:

TREATAS (
    VALUES ( DiscTable[ColumnName] ),

    OrigTable ( ColumnName]
)

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

Hi, Thanks for the response. Yes, page level filters are static and as mentioned above, I am trying to apply those manually to ALL():

_DefaultALL = COUNTX(FILTER(ALL(CALENDAR_DIM[LASTDAY]), CALENDAR_DIM[LASTDAY] >= 1/1/2022), CALENDAR_DIM[LASTDAY])

But somehow this filter CALENDAR_DIM[LASTDAY] >= 1/1/2022 is not getting applied.

How can we apply this?

Thanks.

The format of your lastday column is incorrect. Should say 

>= "2022-01-01"

Yes, thanks. I think you are correct. 🙂

lbendlin
Super User
Super User

ALL removes all filters. Use ALLSELECTED instead.

Thanks for replying. But I have to do a comparison of ALL() and ALLSELECTED(). 🙂
For example, I am selecting months from a slicer and........ IF(ALLSELECTED() = ALL(), DO THIS, DO THAT).

Any way of achieving this?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors