Forum Discussion
Hide Selection but actually use data
Upon further checking, the fiscal year slicer changes the source data used in measures. Is there a way to change its behavior so that instead of selecting data for FY23, it selects data from the beginning to FY23?
yes, by removing FY filter context in your measure.
how does your measure look like?
- Jack0072 years agoFrequent Visitor
My measure calculates sales for FY22
Last year sales =
VAR E =EDATE(MAX('01 Date Table'[Date]),-12)
VAR S = EDATE(E,-12)
VAR ACTIVE =
FILTER(
'SALES TABLE',
'SALES TABLE'[01 PostingDate]>=S&&'SALES TABLE'[01 PostingDate]<=E&&'SALES TABLE'[DataSource]="ACT")
Var result =CALCULATE(SUM('SALES TABLE'[Sales RESTATE]),ACTIVE)/'Display unit'[Display unit selection]
RETURN result
When I make slicer equal to FY23, it changes the datasource to FY23, removing all sales data in FY22, resulting in blank value Last year sales
- FreemanZ2 years ago
Super User
hi Jack007 ,
try like:
Last year sales =VAR E =EDATE(MAX('01 Date Table'[Date]),-12)VAR S = EDATE(E,-12)VAR ACTIVE =FILTER('SALES TABLE','SALES TABLE'[01 PostingDate]>=S&&'SALES TABLE'[01 PostingDate]<=E&&'SALES TABLE'[DataSource]="ACT")Var result =CALCULATE(SUM('SALES TABLE'[Sales RESTATE]),ACTIVE,ALL('01 Date Table'[Date]))/'Display unit'[Display unit selection]RETURN result- Jack0072 years agoFrequent Visitor
It does not work.
I even tried this:
Last year sales =VAR E =EDATE(MAX('01 Date Table'[Date]),-12)VAR S = EDATE(E,-12)VAR ACTIVE =FILTER('SALES TABLE','SALES TABLE'[01 PostingDate]>=S&&'SALES TABLE'[01 PostingDate]<=E&&'SALES TABLE'[DataSource]="ACT")Var result =CALCULATE(SUM('SALES TABLE'[Sales RESTATE]),ACTIVE,ALL('01 Date Table'[Date]),ALL('SALES TABLE'[Date]))/'Display unit'[Display unit selection]RETURN result