Forum Discussion

polman4's avatar
polman4
Helper I
3 years ago
Solved

Dax function ignores slicer

Hello,   I have the following measure that works fine.  asdasd   % Pageviews = VAR _max = CALCULATE ( MAX ( 'nw_content'[Week_Start_Date] ), FILTER ( ALL ( 'nw_...
  • ReneMoawad's avatar
    ReneMoawad
    3 years ago
    Hello polman4,
    Try the below Measure:
     
    diff =
    var _max = CALCULATE(
        MAX('Table'[Column])
        , FILTER(
            ALLEXCEPT('Table', 'Table'[Type])
            , [author] = MAX([author])
            && [Column] < MAX([Column])
        )
    )
    var _pir= CALCULATE(
        SUM([value])
        , FILTER(
            ALLEXCEPT('Table', 'Table'[Type])
            , [author] = MAX([author])
            && [Column] = _max
        )
    )
    var _result= DIVIDE(SUM([value]), _pir) - 1
    return IF(_result = -1, BLANK(), _result)