Forum Discussion

SarathB2's avatar
SarathB2
Frequent Visitor
4 years ago
Solved

Need help on DAX

Hello Experts, I have a table and having one calculated column with Pass/Fail. I want output like if all pass for one category then consider as pass and even one fail occur for that category th...
  • AlexisOlson's avatar
    4 years ago

     Check that the Material has no false value in its group.

     

    Output =
    NOT (
        FALSE
            IN CALCULATETABLE (
                VALUES ( Materials[Check] ),
                ALLEXCEPT ( Materials, Materials[Material] )
            )
    )

     

    Slightly less intuitive but simpler:

    Output =
    CALCULATE (
        SELECTEDVALUE ( Materials[Check] ),
        ALLEXCEPT ( Materials, Materials[Material] )
    )
  • AlexisOlson's avatar
    AlexisOlson
    4 years ago

    Yes, the second one will return blanks when multiple values are present. These get coerced into FALSE values if the column type is a logical boolean.

     

    To work with "Yes" / "No", I think you could just add an argument to SELECTVALUE for what to return instead of blank when there are multiple values. That is, SELECTEDVALUE ( Materials[Check], "No" ).