Help with multiple OR operations selected from one data field.

tbobolz

Board Regular
Joined
Mar 18, 2010
Messages
148
Excel 2010 V1


Hi All,
I hope you can help me with this. I have the following formula with works fine; however, I wish to add two more values to my "OR" statment in this formula. Of course DAX only allows 2 arguments in a OR operation. How could I write this statement to include all 4 values: of XFRHOSPICE, XFROTH, XFRPSY and XFRSNF.

Currently I can only get these two included in the "OR" statement, XFRHOSPICE, XFROTH. Is there a way to nest an IF, OR or AND statement or maybe a completely different way to write this that I am missing?

=CALCULATE([Cases], 'EPSI SOAR MNDOG'[DISCHARGE - FISCAL YEAR]=2014, 'EPSI SOAR MNDOG'[ED FLAG]="NON ED", 'EPSI SOAR MNDOG'[TRAUMA LOG]="", or('EPSI SOAR MNDOG'[ADMISSION SOURCE]="XFRHOSPICE", 'EPSI SOAR MNDOG'[ADMISSION SOURCE]="XFROTH"))


Thanks for any help you can offer.

Terry :rofl:
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Instead of using "OR", you can use "||" between the items. It means the same thing, but doesn't carry the limit of two items. (The same goes for "AND" - you can use "&&".)

Your measure would look like this:
=CALCULATE(
[Cases],​
'EPSI SOAR MNDOG'[DISCHARGE - FISCAL YEAR]=2014,
'EPSI SOAR MNDOG'[ED FLAG]="NON ED",
'EPSI SOAR MNDOG'[TRAUMA LOG]="",
(​
'EPSI SOAR MNDOG'[ADMISSION SOURCE]="XFRHOSPICE" ||
'EPSI SOAR MNDOG'[ADMISSION SOURCE]="XFROTH" ||
'EPSI SOAR MNDOG'[ADMISSION SOURCE]="XFRPSY" ||
'EPSI SOAR MNDOG'[ADMISSION SOURCE]="XFRSNF"​
)​
)
 
Upvote 0
Thank you for the lesson Norah, you have changed my life, this works great! I did get it to work with a nested if statement within the data; however, this is much cleaner!

Terry:cool:
 
Upvote 0

Forum statistics

Threads
1,223,986
Messages
6,175,793
Members
452,670
Latest member
nogarth

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