# If-AND (&&) Statement in Power Pivot



## btodres (Aug 29, 2013)

I am trying to create a measure that will look at 3 columns of numbers and select the lowest number, my formula which is not working  is as follows:

=if(('Pfizer Numbers'[Sum of 300x600 Only]<='Pfizer Numbers'[Sum of 300x250 only]&&
'Pfizer Numbers'[Sum of 300x600 Only]<='Pfizer Numbers'[Sum of 728x90 only]),'Pfizer Numbers'[Sum of 300x600 Only],


if(('Pfizer Numbers'[Sum of 728x90 Only]<='Pfizer Numbers'[Sum of 300x250 only]&&
'Pfizer Numbers'[Sum of 728x90 Only]<='Pfizer Numbers'[Sum of 300x600 only]),'Pfizer Numbers'[Sum of 728x90 Only],


if(('Pfizer Numbers'[Sum of 300x250 Only]<='Pfizer Numbers'[Sum of 300x600 only]&&
'Pfizer Numbers'[Sum of 300x250 Only]<='Pfizer Numbers'[Sum of 728x90 only]),'Pfizer Numbers'[Sum of 300x250 Only],0)))

When I create a similar spread sheet using an excel table and use a similar formula, I get the right answer:

IF(AND([@one]<=[@two],[@one]<=[@three]),[@one],
IF(AND([@two]<=[@one],[@two]<=[@three]),[@two],
IF(AND([@three]<=[@one],[@three]<=[@two]),[@three])))

<colgroup><col></colgroup><tbody>

</tbody>

any help would be greatly appreciated!


----------

