Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Need Help with DAX expression - Opportunity Pipeline - Point in Time

Hi

I am new to PowerBI. Stuck and need help!!

 

We have Opportunities pipeline data in the following format

OpportunityGrossBookingStage1DateStage2DateStage3DateCurrentStage
OP110012/15/20192/10/2020 Stage2
OP215012/1/2019  Stage1
OP32002/1/20203/15/20206/1/2020Stage3
OP425011/1/20191/15/20201/20/2020Stage3
OP530012/15/20196/1/2019 Stage2
OP63501/1/20202/1/20203/1/2020Stage3

 

StageDate fields capture the date on which an opportunity entered that stage.

 

I am trying to create DAX expression for stages (stage1, stage2,stage3.. etc), to use on a Matrix  to show which opportunity was in which stage during a time period.

Generate outputs as below based on Month \ Quarter \ Year. When we run for Quarter\year, it should not just aggregate monthly numbers. Instead, identify opportunities that are in that particual stage at least some point in that Quarter and get sum of gross booking 

 

 JanFebMar
Stage1900750650
Stage2700450300

Or

 

 Q1Q2
Stage11350450
Stage2900600

 

Here is the link to the pbix file

https://drive.google.com/file/d/13dHaYfjNFm4xUqbJL9BLDl4xOD-yTR3Z/view?usp=sharing

 

Any help is appreciated

 

Thanks

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , refer if this can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

10 REPLIES 10
amitchandak
Super User
Super User

@Anonymous , refer if this can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  Thanks for the reference. Based on your reference I was able to create a DAX expression like below which worked. Thanks a bunch for your help.. 

 

I should have joined this community sooner.

 

Stage1 = CALCULATE
(
SUMX(
FILTER
(Opportunities,
Opportunities[Stage1Date] <= MAX('Calendar'[Date]) &&
(ISBLANK(Opportunities[Stage2Date])
|| (Opportunities[Stage2Date] > Max('Calendar'[Date]))
|| (
Opportunities[Stage2Date] >= Min('Calendar'[Date]) &&
Opportunities[Stage2Date] <= max('Calendar'[Date])
)
)
),Opportunities[GrossBooking]
),CROSSFILTER(Opportunities[Stage1Date],'Calendar'[Date],None)
)
AntrikshSharma
Super User
Super User

Upload it to google drive / one drive / drop box and share the link
Anonymous
Not applicable

Thanks for the suggestion @AntrikshSharma . Have uploaded to google drive and link provided

https://drive.google.com/file/d/13dHaYfjNFm4xUqbJL9BLDl4xOD-yTR3Z/view?usp=sharing

Found some data modelling issues and fixed that, see if it works for you now. Remember always make your tables tall rather than wide.

https://drive.google.com/file/d/13dHaYfjNFm4xUqbJL9BLDl4xOD-yTR3Z/view?usp=sharing
Anonymous
Not applicable

@AntrikshSharma  Can you try please uploading the modified file one more time? I am not able to see any changes to the file I uploaded.

 

Thanks again for your help.

 

George Ponnatt

Anonymous
Not applicable

@AntrikshSharma  Unfortunately the calculation below is wrong. It is not a straigtforward SUM()

georgeponnatt_0-1595430014943.png

For example: During Jan 2020, the followings Opps are in Stage 1 : OP1, OP2, OP4, OP5,OP6

Take OP1; it entered Stage1 Date on 12/15/2019. But it continues in that Stage till 2/10/2020, till it enters Stage2. So OP1 is in Stage1 on Jan 2020.

 

So Stage 1 - Jan would be 900.  And Stage 3 -Jan should be 250. In Jan, only OP4 was in Stage 3.

ie.. Stage dates show what date the opportunity entered a stage, and it remains in that stage till it enters Next stage.

 

Appreciate the attempt.

 

 

Can you define the lower boundaries and upper boundaries of each stages, maybe that could help, worth trying.
Anonymous
Not applicable

@AntrikshSharma  Stage boundaries of each opportunity is implied within the above opportunity data itself. Each opportunity starts at Stage1, then moves on to Stage 2 and so on.

Ex:

OP1  (Current Stage is Stage2)

Stage1 12/15/2019 - 2/9/2020

Stage2  2/10/2020  - Current

 

OP2 (Current Stage isStage1)

Stage1    12/1/2019  - Current

 

OP3 (Current stage is Stage3)

Stage1  2/1/2020 - 3/14/2020

Stage2   3/15/2020 - 6/1/2020

Stage3   6/1/2020  - Current

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.