Forum Discussion

Deermeat's avatar
Deermeat
Resolver I
4 years ago
Solved

A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter exp

Hello, I'm trying to find averages for data that is 3 months ago from the current date chosen in the slicer. I have created this measure to solve this issue: I'm only matching Month and Year, as eac...
  • karnold's avatar
    4 years ago

    You can use a VAR in place of the measure:

     

    Score average = 
    VAR _3MonYear = YEAR([3monthsago]
    VAR _3MonMonth = MONTH([3monthsago]
    RETURN
    CALCULATE(
        AVERAGE( Sheet1[Score] ), 
            ALL( Sheet1[Score] ), 
                YEAR(Sheet1[Date]) = _3MonYear,
                MONTH(Sheet1[Date]) = _3MonMonth
    )

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!