Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a 'Opportunity Field History' table. Every row contains a stage change for an opportunity. I need to count opportunities Id's where within the 'New Value' been both "4 - Estimate Generated" and "6 - Closed Won". Because they're not in both stages at the same time, I cannot get my filters to work correctly in my summarize formula. If I use || it counts opportunities that have been in eith stage but not both and && draws and gets zero because they cant be in the stage at the same time. I need to calculate this for both 2023 and 2024.
COUNTROWS(
SUMMARIZE(
FILTER(
'Opportunity Field History',
'Opportunity Field History'[NewValue] = "4 - Estimate Generated" ||
'Opportunity Field history'[NewValue] = "6 - Closed Won"),
'Opportunity Field History'[OpportunityId],
'Opportunity Field History'[NewValue],
'Opportunity Field History'[Created_YR])
)
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please try something like below whether it produces the expected result.
expected result measure: =
VAR _t01 =
SUMMARIZE (
FILTER (
'Opportunity Field History',
'Opportunity Field History'[NewValue] = "4 - Estimate Generated"
&& 'Opportunity Field History'[Created_YR] IN { 2023, 2024 }
),
'Opportunity Field History'[OpportunityId]
)
VAR _t02 =
SUMMARIZE (
FILTER (
'Opportunity Field History',
'Opportunity Field History'[NewValue] = "6 - Closed Won"
&& 'Opportunity Field History'[Created_YR] IN { 2023, 2024 }
),
'Opportunity Field History'[OpportunityId]
)
VAR _intersectlist =
INTERSECT ( _t01, _t02 )
RETURN
COUNTROWS ( _intersectlist )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi,
I am not sure if I understood your question correctly, but please try something like below whether it produces the expected result.
expected result measure: =
VAR _t01 =
SUMMARIZE (
FILTER (
'Opportunity Field History',
'Opportunity Field History'[NewValue] = "4 - Estimate Generated"
&& 'Opportunity Field History'[Created_YR] IN { 2023, 2024 }
),
'Opportunity Field History'[OpportunityId]
)
VAR _t02 =
SUMMARIZE (
FILTER (
'Opportunity Field History',
'Opportunity Field History'[NewValue] = "6 - Closed Won"
&& 'Opportunity Field History'[Created_YR] IN { 2023, 2024 }
),
'Opportunity Field History'[OpportunityId]
)
VAR _intersectlist =
INTERSECT ( _t01, _t02 )
RETURN
COUNTROWS ( _intersectlist )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Thank you Jihwan_Kim. This worked. I did try a similar version using UNION and count. It wasnt working correctly though. I'll dig into it later. This is the first time I've used INTERSECT.
Thanks again
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
50 | |
38 | |
38 |
User | Count |
---|---|
195 | |
80 | |
70 | |
51 | |
42 |