Forum Discussion

rwyoung01's avatar
rwyoung01
Frequent Visitor
7 years ago

SelectedValues will not filter on multiple values

I am trying to filter a table based on  certain values in a column and am getting an error message that the expression refers to multiple columns which cannot be converted to a scalar value

 

AccountTypeWPrisoner = if (SELECTEDVALUE('Main Account'[AccountType]) = "Main Account Types(with Prisoners)", FILTER(Accounts,Accounts[AccountType] in {"Business","Chaplain","Church","Directgiv","Ministry","Minor","Prisoner","Regular","Orgcontact"}))

10 Replies

  • Hello,

     

    What data types are 'Main Account'[Account Type] and 'Accounts'[Account Type] ?

     

    Regards,

    ElenaN

      • v-cherch-msft's avatar
        v-cherch-msft
        Microsoft Employee

        Hi rwyoung01 

         

        You may try below measure and drag it into table visual or use it as visual level filter.If it is not your case,please show us some screenshot of the table and error.

        AccountTypeWPrisoner =
        IF (
            SELECTEDVALUE ( 'Main Account'[AccountType] ) = "Main Account Types(with Prisoners)"
                && MAX ( Accounts[AccountType] )
                    IN {
                    "Business",
                    "Chaplain",
                    "Church",
                    "Directgiv",
                    "Ministry",
                    "Minor",
                    "Prisoner",
                    "Regular",
                    "Orgcontact"
                },
            1
        )

        Regards,

        Cherie