cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mbelobaba
Frequent Visitor

IF - multiple conditions

Hi, 

 

I'm using a matrix and having measure IDs in columns, and user names in rows. 
I need to create a calculated column to use it for conditional rule on measure values. 

I'm using IF statements and it's working for a calculation on a single measure but what I need now is to set a calculation to look if two measures are reached the target. If both reached, then both should be green. If one did not reach the target, then both should stay white. 

 

I tried this but it's not working as needed:
IF(AND(Table[measure_id]=7 && Table[value]<=Table[target],Table[measure_id]=8 && Table[value]>=Table[target]),1)

 

PBI-table.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Any ideas how can this be resolved?

 

Thank you, 

Maja

6 REPLIES 6
amitchandak
Super User IV
Super User IV

@mbelobaba , If this is a measure. Then you need use measures of summarized columns

example

IF(AND(max(Table[measure_id])=7 && sum(Table[value])<=sum(Table[target]),max(Table[measure_id])=8 && sum(Table[value])>=sum(Table[target])),1)



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Hi @amitchandak

I'm using calculated column with multiple IF statement for every measure. 

 

Thanks, 

Maja

@mbelobaba , what is the challenge. You can color green when value of the measure on top this column is 1.

 

or can create a color measure and use it with field value.

 

if([Measure]=1, "green", "white")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak, well I have other conditions to be met besides the measure ID

Can this be calculated in the background? Using calculatetable or something else?

Thanks, 

Maja

Hi @mbelobaba ,

 

The logic of your formula won't work. How can a Measure ID equal two different numbers at the same time?

You may provide some sample data and the results you expect to see if we can help you solve the problem.

Please mask any sensitive data before uploading

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power BI User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.