Forum Discussion
How to use FILTER with ALL?
- 4 years ago
The format of your lastday column is incorrect. Should say
>= "2022-01-01"
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]
)
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.