Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

DAX IF statement

Dear community,

 

I've got the following formula:

measure = IF(FILTER('rapportage'; 'rapportage'[Lesson Completion] = "completed" || 'rapportage'[Lesson Success] = "passed"); TRUE();FALSE())
 
It gives me an error: 
Measure refers to multiple collums. Why exactly?

3 Replies

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi Anonymous ,


    The reason is accurately what Greg has said, but if you want to get result from multi rows, you can try to use the following formula:

     

    measure =
    CALCULATE (
        COUNTROWS ( 'rapportage' );
        'rapportage'[Lesson Completion] = "completed"
    ) > 0
        || CALCULATE (
            COUNTROWS ( 'rapportage' );
            'rapportage'[Lesson Success] = "passed"
        ) > 0

     


    By the way, PBIX file as attached.


    Best regards,

     

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi Anonymous ,

     

    How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


    Best regards,