The condition for an action has to return a boolean value the string "Except([Measures].CurrentMember, { some comma separated measure names }).count=0" is not a boolean. If there is some complex logic to work out the list of measures to exclude
you could change your function just to return that list.