 # Dax calculation with filter

Hi All,

I am having problems with a dax formula. I need to calculate the addition of the max% (yellow column). These values belongs to a table where i have a set of criteria (1,2,3…9) different per year and this needs to be applied to each group. So for the year 2017 I have 1,2,3,4,8,9, for the year 2018 1,2,3,4,5,6,8,9 and for the year 2019 1,2,3,4,5,6,7,8,9. The formula that i am using and its not working is because i am getting the sum for all ids without taking into account the year:

``````Max % =
CALCULATE (
SUM ( 'dwh group'[max_Value_] );
( 'Calendar'[Year] );
'dwh group'[Calculation] = "Yes";
'rpt v_group'[group_id]
)
``````

An additional question, if i have a report level filter (calculation=“yes”), do i need to use it still in the dax formula for a measure?

Kind regards,
Aracelli

I have also tried the following formula without success:

``````Max % =
CALCULATE (
SUM ( 'dwh group'[max_Value_] );
FILTER (
ALLSELECTED ( 'Calendar' );
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)``````

Aracelli,

Please clarify what exactly you want answered. A PBIX file would make it easier for me to understand what is happening. If you do have a measure already for calculation= “yes”, in most cases you will want to use it instead of the full calculation to make the measure a bit cleaner, but if you use the full calculation it will work the same.

Thanks
Jarrett You shouldn’t need to put calendar year to filter by when you already have a slicer on the sheet filtering.

Also, make sure the slicer is actually filtering the visual (tab format then edit interactions)