Forum Discussion
data23f
6 years agoHelper I
Find the date difference for a single column
Hi, I have a Date field in a table. My goal is to create a new column that calculates the date difference from the previous date in # of days. For example: • 1/17/20 an...
- 6 years ago
HotChilli
6 years agoCommunity Champion
Dropbox or similar and post the link
data23f
6 years agoHelper I
HotChilli I don't want to share a folder which perhaps can have confidential information. So instead, I'm sticking with the screenshot. The data is very simple.
This is done in Excel and in the Output field it's calculating the # of days difference from the previous date.
The slicer just had a way of segmenting the data from Country, Region. But I should be able to incorporate this once the new column is calculated.
Hope this helps.
- HotChilli6 years agoCommunity Champion
A column for the simple example
ColumnA = VAR _date = TableCats[Date] VAR _prevDate = CALCULATE(MAX(TableCats[Date]), FILTER(TableCats, TableCats[Date] < _date)) RETURN DATEDIFF(_prevDate, _date , DAY)For future posts, please post data directly (you can paste it into the post) or anonymise the data and link a pbix
- Ashish_Mathur6 years agoSuper User