Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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? 

2 Replies

  • 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")
             )