cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Richard_Halsall
Frequent Visitor

Compare Historical/Changed data

Hi, I am looking for advice

 

I have 3 tables:

DimOpportunity - containing sales opportunities

FactRevenue - containing current expected revenues against the opportunity on a monthly basis

OpportunityFieldHistory - containing dates, stage status and probability percentage

 

An opportunity goes through 5 stages over its date range with a different probability percentage at each stage. Total opportunity revenue is calculated by the sum of revenues multiplied by the stage percentage, the model looks as below:

 

comparehistorical.PNG

 

I am trying to calculate things all based on relative date selection, opportunity total revenue (calculated as sum of revenue * stage probability) and stage these include:

 

New opportunities in the last 7 days and their total revenue value i.e. changetype = 'created'- completed

Opportunitiesin the last 7 days cancelled and their total revenue value  i.e. changetype = 'cancelled'- completed

 

Opportunities and their total revenue value where there has been no change in their stage in the last 7 days i.e. changetype today equals changetype 7 days ago so value is exactly the same now as it was 7 days ago- stuck

 

Opportunities and their total revenue value where there has been a change in their stage in the last 7 days i.e. changetype today does not equal changetype 7 days ago so value will be different now as it was 7 days ago- stuck

 

As a further complication an opportunity may 'pass' through multiple stages in a time period so need to only look at the latest stage.

 

7 days could be 14 days could be 30 days etc

 

Any help much appreciated, thanks

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @Richard_Halsall 

 

Could you please show us some sample data and expected results with OneDrive for business? Do mask sensitive data before uploading. Thanks.

 

Best Regards

Allan

 

 

Hi Allan

I have attached a data file (excel) with sample data from the 3 main tables plus a results tab. If further clarification is required please let me know.

 

Many thanks

 

Richard

Data File 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors