cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Community Support Team
Community Support Team

Re: If does not work with 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.

View solution in original post

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 your question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
Ross73312 Super Contributor
Super Contributor

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!


   


Anonymous
Not applicable

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 @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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 524 members 4,437 guests
Please welcome our newest community members: