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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dawson16
Frequent Visitor

Finding Change in Start Date Between Snapshots

Hello, I've been trying to create a calculated column in my workbook that calculates the change in start date for each Activity ID since the last snapshot was taken. Snapshots are taken on the first of every month, and activities could move forward, backward, stay the same, be completed or cancelled, or be newly added in each snapshot. I can't figure out how to create this formula in DAX, so I was wondering if someone would be able to help me out? I've included a sample image of what I'm going for below with the highlighted column being the one I'm trying to create. I really appreciate any help anyone can offer!

Dawson16_0-1657032480124.png

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a column like

Start Date Diff =
var currentID = 'Table'[Activity ID]
var currentStartDate = 'Table'[Start Date]
var currentSnapshot = 'Table'[Snapshot Date]
var prevStartDate = LOOKUPVALUE( 'Table'[Start Date], 'Table'[Activity ID], currentID,
'Table'[Snapshot Date], EOMONTH(currentSnapshot, -2) + 1
return currentStartDate - prevStartDate

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

You could create a column like

Start Date Diff =
var currentID = 'Table'[Activity ID]
var currentStartDate = 'Table'[Start Date]
var currentSnapshot = 'Table'[Snapshot Date]
var prevStartDate = LOOKUPVALUE( 'Table'[Start Date], 'Table'[Activity ID], currentID,
'Table'[Snapshot Date], EOMONTH(currentSnapshot, -2) + 1
return currentStartDate - prevStartDate

Thank you for the quick answer. When I use this formula for my column, the result is either the same as that row's Start Date or December 30, 1899. If I format the column as a whole number, the difference is in the 43,000s or is 0. Do you know what might be going wrong?

I would start by changing the return statement to return each of the variables in turn, e.g.

return currentID

and then check the values in the column to see if they are what you would expect. That should help to identify where the problem lies

Thanks John, this worked for what I was going for!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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