Simple IIF formula not working, what am I doing wrong?

Hi,
I tried to define a simple new calculated measure:
iif( Isempty([Measures].[Issue Start Date]),
now(),
[Measures].[Issue Start Date]
)

The logic is very simple: I look in the issue property “Start Date” (A custom field). If it’s empty, I would like to get now(), otherwise I would like to get the start date.

However, I got this error:
Formula is not valid: No function matches signature ‘iif(, , )’

What am I doing wrong?
I used IIF many times until now without any problem. This is is not working for some reason

Hi,

Unfortunately, the IIF function can not work with the date datatype. The reason is the implementation of the MDX language by Mondrian. Please, check here the allowed signatures of the IIF function: http://mondrian.pentaho.com/documentation/mdx.php

The workaround is to use a similar CASE construction:
​```
case when
Isempty([Measures].[Issue Start Date]
then
now()
else
DateParse([Measures].[Issue Start Date])
end

1 Like

Great! Indeed it works now. Thank you