Forum Discussion
Creating a measure with multiple conditions
I am looking to calculate # of bids, when Job Phase equals certain conditions. How do we do it for more than one condition?
NumberofSales = Calculate(DISTINCTCOUNT(Master[Bid_Number__c]),Master[Job.Job_Phase__c]="closed")
For example, I want to include not only "closed" but "in process", "confirmed"
Thanks!
check that the calculated colum is working as expected. Without seeing more of the model its hard to see whats wrong.
//if this is a solution please mark as such
Hi Rsanjuan,
You can use the follow DAX expression to get your expected result.
Count = CALCULATE(DISTINCTCOUNT(Master[ID]),FILTER(ALL(Master),Master[Job.Job_Phase__c]="closed"||Master[Job.Job_Phase__c]="in process"||Master[Job.Job_Phase__c]="confirmed"))Regards,
Charlie Liao
23 Replies
- v-caliao-msftMicrosoft Employee
Hi Rsanjuan,
You can use the follow DAX expression to get your expected result.
Count = CALCULATE(DISTINCTCOUNT(Master[ID]),FILTER(ALL(Master),Master[Job.Job_Phase__c]="closed"||Master[Job.Job_Phase__c]="in process"||Master[Job.Job_Phase__c]="confirmed"))Regards,
Charlie Liao
- samdthompsonMemorable Member
Hi, the cool thing about calculate is you can put multiple filters after it so:
NumberofSales = Calculate(DISTINCTCOUNT(Master[Bid_Number__c]),
filter(Master[Job.Job_Phase__c])="closed",
filter(table[1])="condition1",
filter(table[2])="condition2",
filter(table[n])="condition_n")
should do the job for you.
//if this is a solution please mark as such.
- RsanjuanAdvocate III
It seemed to not work. I entered this:
NumberofSales = Calculate(DISTINCTCOUNT(Master[Bid_Number__c]),Master[Job.Job_Phase__c]="closed",filter(Master, Master[Job.Job_Phase__c]="confirmed"))
Those conditions are all under the same table and same field "Job Phase". Am I doing something wrong?
- samdthompsonMemorable Member
try this:
NumberofSales = Calculate(DISTINCTCOUNT(Master[Bid_Number__c]),
filter(Master[Job.Job_Phase__c])="closed",
filter(Master, Master[Job.Job_Phase__c])="confirmed")
// if this is a solution please mark as such
- eka8742Regular Visitor
How can the result (15 in this case) be sliced versus shown as a static number?
- AnonymousNot applicable
I want to count in datset if NCR status is "Open" and Proposed Action Status, please help
Open & Accepted = CALCULATE(COUNT(NCR[NCR Closeout Status]),NCR[NCR Closeout Status]="Open"&& NCR[Proposed Action Status]="Accepted"))- Ashish_MathurSuper User
Hi,
I do not see any mistake in your formula. What problem are you facing?
- AnonymousNot applicable
The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.
- AnonymousNot applicable
Thanks Bro.. This was solved my requirement...😀