Forum Discussion

grggmrtn's avatar
grggmrtn
Post Patron
7 years ago
Solved

Complex filtering problem

Our data comes from a questionnaire with the columns [Person] (who filled out the questionnaire), [Question], [Answer], and [Year] (when the question was answered.  It looks something like this: Per...
  • v-cherch-msft's avatar
    v-cherch-msft
    7 years ago

    Hi grggmrtn 

    You may add a key column and use it as slicer.Then change the measure as below:

    Measure = 
    VAR a =
        CALCULATETABLE (
            VALUES ( Question[Person] ),
            FILTER ( ALL ( Question ), Question[Key] IN VALUES ( Slicer[Key] ) )
        )
    RETURN
        CALCULATE (
            COUNT ( Question[Person] ),
            FILTER ( Question, Question[Person] IN a )
        )
    

    Regards,