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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.