Forum Discussion
JCBI1023
Helper III
8 years agoCalculate Sum with Multiple And Or Filters
Hello Masters, thank you for looking at this. I have a measure that sums up all opportunities [# of Opportunities]. Each Opportunity has a Status and a Stage. Status: Won, Lost, Open St...
- 8 years ago
Hi JCBI1023
If Open Opportunity requires both conditions, you should use AND(&&) instead of OR(||)
Open Opportunity = Status is Open AND the Stage is NOT In SubmittalOpen = CALCULATE ( [# of Opportunities], FILTER ( 'Opportunity Products Advanc', 'Opportunity Products Advanc'[Status (Opportunity)] = "Open" && 'Opportunity Products Advanc'[Opportunity Stage (Opportunity)] <> "In Submittal" ) )
For WON try thisWON = CALCULATE ( [# of Opportunities], FILTER ( 'Opportunity Products Advanc', OR ( 'Opportunity Products Advanc'[Status (Opportunity)] = "Open", 'Opportunity Products Advanc'[Status (Opportunity)] = "WON" ) && 'Opportunity Products Advanc'[Opportunity Stage (Opportunity)] = "In Submittal" ) ) - 8 years ago
WON = CALCULATE ( [# of Opportunities], FILTER ( 'Opportunity Products Advanc', ('Opportunity Products Advanc'[Status (Opportunity)] = "Open" && 'Opportunity Products Advanc'[Opportunity Stage (Opportunity)] = "In Submittal") || 'Opportunity Products Advanc'[Status (Opportunity)] = "WON" ) )
JCBI1023
Helper III
8 years agoZubair_Muhammad We are VERY CLOSE, Thank you so much.
So, let me rephrase what WON means...
Won = Status is Won. In addition... Statuses that are Open but have a Stage of In Submittal ... should also be considered as Won.
So, if the Status is Won, it;'s Won. Also, if, the Status is set to Open but the Stage is In Submittal then it's also won.
So this should be shown as 4 Won. It doesn't matter what the Stage is, if the status is Won... then it's Won.
parry2k
Super User
8 years agoWON =
CALCULATE (
[# of Opportunities],
FILTER (
'Opportunity Products Advanc',
('Opportunity Products Advanc'[Status (Opportunity)] = "Open" && 'Opportunity Products Advanc'[Opportunity Stage (Opportunity)] = "In Submittal") ||
'Opportunity Products Advanc'[Status (Opportunity)] = "WON"
)
)