Forum Discussion

eliasayyy's avatar
eliasayyy
Memorable Member
10 months ago
Solved

Matrix Filtering is Confusing please help

Hello everyone, i cant seem to understand the logic behind the filtering in matrix i am adding a measure called weekcheck to filter out dates based on a number range paramater to go back x number ...
  • danextian's avatar
    10 months ago

    Hi eliasayyy 

    Try creating a filtered measure instead

    Filtered Measure =
    VAR ReferenceDate =
        CALCULATE ( MAX ( dimDate[StartOfWeek] ), REMOVEFILTERS ( dimDate ) )
    VAR NumDays =
        SELECTEDVALUE ( Parameter[Parameter] ) * 7
    VAR StartDate = ReferenceDate - NumDays
    RETURN
        CALCULATE ( [your measure], KEEPFILTERS ( dimDate[StartOfWeek] >= StartDate ) )