Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

Hi @Anonymous,

 

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.

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

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

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

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
Anonymous
Not applicable

Thanks!

 

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

Hi @Anonymous,

 

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.