## Desktop

Regular Visitor
Posts: 22
Registered: ‎02-10-2018

# If does not work with a meassure

I've this if statement

```Semaforo_tiem_acum =
IF([mom_tiem_acum]> 50;"Above 0"; "Below 0")
// UNICHAR(9650);UNICHAR(9660)```

But it's not working because always is false:

The measure which is evaluated in order to change the color is the following:

```mom_tiem_acum =
VAR PREV_MONTH =
CALCULATE(
)
RETURN

Should I use any filter?

Thanks!

Accepted Solutions
Highlighted
Community Support Team
Posts: 2,906
Registered: ‎02-06-2018

## Re: If does not work with a meassure

Hi @joaco,

If I understand your scenario correctly that the Semaforo_tiem_acum with if statement is a calculted column, you mean that the if fucntion does not work with the measure mom_tiem_acum?

If it is, I have made a test try to reproduce your scenario. Here is my test result.

If you still need help, please share your sample data and desired output so that we could help further on it.

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

All Replies
Super User
Posts: 1,439
Registered: ‎06-24-2015

## Re: If does not work with a meassure

Hey,

I'm not sure what you would expect.

I expect that your measure Semaforo_tiem_acum (I guess it's a measure and not a calculated column) does not return values that meet your expectation.

If this is the case you have to focus on your condition

`[mom_tiem_acum]> 50`

From what I can see from the screenshot it's correct that this condition always evaluates to false "Below 0", because no value value in column is above 50, maybe you have to consider to change this condition to something like

`[mom_tiem_acum]> 0`

If my assumptions are not correct, than maybe you should consider to describe your expectations in more detail, ans alos consider to provide sample data that can easily be used, e.g. create an Excel file with sample data, upload the file to onedrive or dropbox and share the link.

Regards,

Tom

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Super User
Posts: 1,830
Registered: ‎02-28-2017

## Re: If does not work with a meassure

I should also point out, as its a common error, that percentages are expressed as decimal values.

If your intention was to check if something is above 50%, you want your condition to be

`[mom_tiem_acum] > 0.50`

Proud to be a Datanaut!

Regular Visitor
Posts: 22
Registered: ‎02-10-2018

## Re: If does not work with a meassure

Thanks!

The problema was that I used a column rather than a meassure!

Highlighted
Community Support Team
Posts: 2,906
Registered: ‎02-06-2018

## Re: If does not work with a meassure

Hi @joaco,

If I understand your scenario correctly that the Semaforo_tiem_acum with if statement is a calculted column, you mean that the if fucntion does not work with the measure mom_tiem_acum?

If it is, I have made a test try to reproduce your scenario. Here is my test result.

If you still need help, please share your sample data and desired output so that we could help further on it.

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.