Measure to identify based on criteria

one3nine0

Board Regular
Joined
Jul 21, 2014
Messages
127
I have a table in powerpivot showing invoices, and two calculated columns to identify Product A (1) or Product B (2)

InvoiceProductUnitsPriceCalculated Column 1Calculated Column 2
100A1100TrueFalse
100B150FalseTrue
101C1
100FalseFalse
101A1100TrueFalse
101D125FalseFalse
102B150FalseTrue
102A1100TrueFalse
102C1100FalseFalse

<tbody>
</tbody>

I want to be able to write a measure that will identify if each invoice has both "True" in calculated columns 1 and 2.

That way when I pivot it out, I can see the invoice number, products bought, total spend, and if a true/false if the invoice has both products A and B.

Any Suggestions?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Code:
=IF(
    CONTAINS (
        Table, 
        Table[Product],
        "A"
    ) &&
    CONTAINS (
        Table, 
        Table[Product],
        "B"
    ),
    "Yes",
    "No"
)
 
Last edited:
Upvote 0
Thanks this works exactly how I asked!

I unfortunately now know I forgot to include details to my question because it did not work they way I wanted.

So the measure works perfectly if I pivot based on invoice number.

The problem, is that I need to get down to the products bought as well. But if I add products to the pivot table, the "Criteria" measure shows No for everything.

Is there a way to include products to the table, but the criteria only answer on the invoice level?
 
Upvote 0
Wrap the previous measure in a CALCULATE with second parameter as an ALLEXCEPT on Invoice.
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,941
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top