I´m new to DAX and have a question regarding filtering measures. As you can see in the attachment, I want to filter both measures, volume CY (current year) and volume LY only for year 2018.
Volume LY Volume CY
2016 65.024.635
2017 65.024.635 63.602.450
2018 63.602.450 21.597.407
I want to link the filtering with an indicator (Counter). This counter has values in range [0-3]. Each year has semesters, for example Current Year has semester 0 and 1, 2017 - 2 and 3, 2016 - 4 and 5. In this case, I want to select 1 for the counter and it should filter semester <= 1 for the year 2018:
Volume LY Volume CY
2018 63.602.450 21.597.407
But if I filter measure volume CY with:
FILTER(ALLSELECTED(Table);Table[Semester]<=MAX('Table2'[Counter]));
then measure Volume LY automatically gets filtered for semester <= 1 and it won´t show values for LY. My questions is: How can i use filter function to get values for both measures for current year?
Measure Volume Current Year:
Volume_CY:=CALCULATE(
[Volume];
'Scenario'[Scenario1]=1;
FILTER(Table;Table[Semester]<=MAX('Table2'[Counter])))
Measure Volume LY:
Volume LY:= CALCULATE(
[Volume_CY];
FILTER(ALLSELECTED(Table);Table[Semester]<=MAX('Table2'[Counter]));
FILTER(ALL(Table[Year]))
Here is the result of this two measures with counter 1 and scenario 1: As you can see it doesn´t show the LY Value which should be 63.602.450.
Scenario 1
Counter 1
Volume LY Volume CY
2018 21.597.407
Total 21.597.407
Now i have a result like this:
Volume CY Volume LY
20151 77.222.12 77.222.12
20152 88.868.719 88.868.719
20161 87.987.22 87.987.22
20162 92.906.793 92.906.793
20171 101.102.12 101.102.12
20172 105.029.725 105.029.725
And this is what i´m expecting:
Volume CY Volume LY
20151 77.222.12
20152 88.868.719 49.123.12
20161 87.987.22 77.222.12
20162 92.906.793 88.868.719
20171 101.102.12 87.987.22
20172 105.029.725 92.906.793
Volume_LY:=CALCULATE( [Volume]; 'Scenario'[Scenario1]=1; FILTER(Table;Table[Semester]<=MAX('Table2'[Counter])-2))- user5226582