-1

I need to calculate measure if the string contains a specific character. I tried the following code:

IIF
(FILTER([Client for GPS].[External ID], Instr([Client for GPS].[External ID].CURRENTMEMBER.name,"-",1)),

[Measures].[Calls Count],
NULL)

But it shows all NULL values as a result

What is wrong here?

Samuel Hulla
  • 6,617
  • 7
  • 36
  • 70

1 Answers1

0

Maybe the IIF and FILTER need to be the other way around:

FILTER(
[Client for GPS].[External ID],
IIF(
  INSTR(
       [Client for GPS].[External ID].CURRENTMEMBER.name
       ,"-"
       ,1
   ) > 0
,[Measures].[Calls Count]
,NULL
)
whytheq
  • 34,466
  • 65
  • 172
  • 267