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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Transactional history data to snapshot format?

Long time lurker who for the first time cannot find a good answer to a question in this forum!

 

Whats the simplest, and lowest overhead, way of transforming transactional history data to a snapshot format?

 

We're using Salesforce CRM, which we then query into PowerBI to build our sales dashboards, so here's the simple example: An opportunity in the sales pipeline can change status, with a modified date, in the history table. How would I get from this history table:

 

Opportunity   NewStage    OldStage     Time

Oppty-1         Won           Upper Pipe   2018-11-26

Oppty-1         Upper Pipe  Mid Pipe      2018-11-20

Oppty-1         Mid Pipe      Lower Pipe  2018-11-09

 

To this form of snapshot table:

Opportuntiy   Current        7-days ago        14-days ago    

Oppty-1        Won             Upper Pipe         Mid Pipe

  

 

I'm guessing there's an easy answer for this out there somewhere!

 

2 REPLIES 2
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

Based on my test, you could use the below formula:

Create a new table:

Table = SUMMARIZE('Table1','Table1'[opportunity],"Current",CALCULATE(MAX('Table1'[NewStage]),FILTER(ALL('Table1'),'Table1'[Time]=DATE(2018,11,26))),
                                                 "7-days-ago",CALCULATE(MAX('Table1'[NewStage]),FILTER(ALL('Table1'),'Table1'[Time]=DATE(2018,11,20))),
                                                 "14-days-ago",CALCULATE(MAX('Table1'[NewStage]),FILTER(ALL('Table1'),'Table1'[Time]=DATE(2018,11,09))))

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Nice, thats almost what I was looking for. I assume that the MAX function won't work well if I have several movements within the same date span (i.e. between two snapshot dates), since I would want the last change before the "snapshot" date. Is there an alternative?

 

Thanks!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors