Forum Discussion
Anonymous
6 years agoNot applicable
Ignoring filter within DAX using multiple filters
Hi all,
I'd like to show the current year values regardless of the selected year in the filter pane. Here's my code:
FCosts_YTD =
CALCULATE(
SUM(PERFORMANCE[VALUE_2])
;FILTER(ALL(PERFORMANCE);PERFORMANCE[YEAR]=[Actual_Year])
;FILTER(PERFORMANCE;PERFORMANCE[ENTRY_TYPE]="REAL")
;FILTER(PERFORMANCE;PERFORMANCE[TYPE]="FCOST")
)
This one works fine:
FCosts_YTD =
CALCULATE(
SUM(PERFORMANCE[VALUE_2])
;FILTER(ALL(PERFORMANCE);PERFORMANCE[YEAR]=[Actual_Year])
)
It seems like whenever I use multiple filters the ignore filters approach doesn't work anymore. Does anyone know how to handle that?
Anonymous
You may take a look at the article below.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
2 Replies
- amitchandakSuper User
For such a scenario, move year to a different table and join it back with your table.
FCosts_YTD =CALCULATE(SUM(PERFORMANCE[VALUE_2]);FILTER(ALL(YEAR);YEAR[YEAR]=[Actual_Year]);FILTER(PERFORMANCE;PERFORMANCE[ENTRY_TYPE]="REAL");FILTER(PERFORMANCE;PERFORMANCE[TYPE]="FCOST")) - v-chuncz-msftCommunity Support
Anonymous
You may take a look at the article below.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/