override selection
1 TopicDAX year comparison - Why does this not work?
Hi. I'm trying to set up a number of standard formula to be used in my PBI reports. users are supposed to select 1 year. Also they can select additional filters such as YTD and whatever you have . In any case : Asume selected is (only) 2022 in the date filter. (The following works) TEST_TY = VAR __YEARSELECTION = CALCULATE(MAX('Date'[Year])-0) VAR __BASEFORMULA = CALCULATE([Product SO],FILTER('Date','Date'[Year]=__YEARSELECTION)) RETURN __BASEFORMULA (This does not - Except then selecting both 2022 AND 2021) TEST_TY = VAR __YEARSELECTION = CALCULATE(MAX('Date'[Year])-1) VAR __BASEFORMULA = CALCULATE([Product SO],FILTER('Date','Date'[Year]=__YEARSELECTION)) RETURN __BASEFORMULA Why does the following above not work? How do I override the 2022 selection? TEST = CALCULATE(sum(_actuals[product_sales_eur]),FILTER('Date','Date'[Year]=2021)) also does not work Please not that I do not only want to look 1 year back, but will want to do 2020 aswell etc. Thanks!927Views0likes3Comments