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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
edayeh
New Member

Calculate Snapshot Data Delta -

Hello

 

I am trying to get deltas from snapshotted data and I can't seem to figure out how. 

I snapshotdata (in SFDC) daily by Account and ARR for that account and bring store that value. I would love to be able to calculate the delta of any daily changes for a specific account. Below is what I would love to get.

I want to create a colum (Delta below) that will show me what accounts changed from the previous date. Small sample size below. 

 

NameARRDateDelta
Account 1 $    68,22329-Oct 
Account 1 $    26,65630-Oct($41,567)
Account 2 $    68,16229-Oct 
Account 2 $    68,16230-Oct$0
Account 3 $  177,32429-Oct 
Account 3 $      1,67930-Oct($175,645)
Account 4 $    12,81929-Oct 
Account 4 $      8,07130-Oct($4,748)
Account 5 $          18029-Oct 
Account 5 $          18030-Oct$0

I have over 500 accounts so the snapshot have over 500 records daily. 

 

How can I get a formula to show me this? thanks in advance

1 ACCEPTED SOLUTION
camargos88
Community Champion
Community Champion

@edayeh ,

 

You can use this code to create a calculated column:

Delta = 
VAR _date = CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[Date] < EARLIER('Table'[Date])))
RETURN IF(_date <> BLANK(), CALCULATE(SUM('Table'[ARR]), FILTER('Table', 'Table'[Name] = EARLIER('Table'[Name]) && [Date] = _date)) - 'Table'[ARR], BLANK())

 

Capture.PNG



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
camargos88
Community Champion
Community Champion

@edayeh ,

 

You can use this code to create a calculated column:

Delta = 
VAR _date = CALCULATE(MAX('Table'[Date]), FILTER('Table', 'Table'[Date] < EARLIER('Table'[Date])))
RETURN IF(_date <> BLANK(), CALCULATE(SUM('Table'[ARR]), FILTER('Table', 'Table'[Name] = EARLIER('Table'[Name]) && [Date] = _date)) - 'Table'[ARR], BLANK())

 

Capture.PNG



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



THANK YOU SO MUCH.....YES

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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