cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
joaco Regular Visitor
Regular Visitor

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:

Always False.JPG

 

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

 

mom_tiem_acum = 
VAR PREV_MONTH =
	CALCULATE(
		SUM('Reporte Acumulado'[Tiempo]);
		DATEADD('Fecha'[Date]; -1; MONTH)
	)
RETURN
	DIVIDE(SUM('Reporte Acumulado'[Tiempo]) - PREV_MONTH; PREV_MONTH)

 

Should I use any filter?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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.PNG

 

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.
4 REPLIES 4
Super User
Super User

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
Super User

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

   

              Did I answer your question? Mark my post as a solution!
       

Proud to be a Datanaut!


   


Highlighted
joaco Regular Visitor
Regular Visitor

Re: If does not work with a meassure

Thanks!

 

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

Community Support Team
Community Support Team

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.PNG

 

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.