OR() behaving odd...

So I have this formula, which is one part of a larger AND() equation.  But this bit is coming up as FALSE when it really should be TRUE.  So it makes the entire AND() FALSE.

OR(
IN("All",ANY(Select(Report[Customer],TRUE))),
IN([Customer].[Name],ANY(Select(Report[Customer],TRUE)))
)

ANY(Select(Report[Customer],TRUE)))="All" for reference. Also there is only ever 1 row in the entire Report table.  So the ANY() can't be getting any other data.

The first bit is definately true - 

IN("All",ANY(Select(Report[Customer],TRUE)))

But the second bit is neither true nor false - 

IN([Customer].[Name],ANY(Select(Report[Customer],TRUE)))

Since by an unusal quirk [_ThisRow].[Customer] is blank so [Customer].[Name] doesn't work.  

By simply adding something in [_ThisRow].[Customer] the OR(...) now equals TRUE.

Any ideas?  Must be some weird coding quirk I've missed somewhere...

Solved Solved
0 4 249
1 ACCEPTED SOLUTION

Makes sense.
Then...

 

OR(
  IN(
    "All",
    SPLIT(CONCATENATE(Report[Customer]), " , ")
  ),
  IN(
    [Customer].[Name],
    SPLIT(CONCATENATE(Report[Customer]), " , ")
  )
)

 

View solution in original post

4 REPLIES 4

Remove the ANY() from around your Select statement, OR, add a LIST() around your ANY(Select(Report[Customer],TRUE)))="All".

The IN() funtion looks for a match in a LIST of items and ANY returns only 1 item that is not a list.

Well, if you are checking for ANY item in the list, and IN() expects a list anyways, would you try with:

OR(
  IN(
    "All",
    Report[Customer]
  ),
  IN(
    [Customer].[Name],
    Report[Customer]
  )
)

OR

OR(
  "All"=INDEX(Report[Customer], 1),
  [Customer].[Name]=INDEX(Report[Customer], 1)
)

 

So Report[Customer] is an ENUMLIST

Makes sense.
Then...

 

OR(
  IN(
    "All",
    SPLIT(CONCATENATE(Report[Customer]), " , ")
  ),
  IN(
    [Customer].[Name],
    SPLIT(CONCATENATE(Report[Customer]), " , ")
  )
)

 

Top Labels in this Space