Forum Discussion
Find the date difference for a single column
- 6 years ago
Can you clarify this please "Also, this column needs to be dynamic meaning if a value is selected in a slicer, then this new column should reflect the new calculation difference."
What is in the slicer?
If you post some sample data (not a picture) and desired outcome ,someone will help you out.
I'm trying to attach a sample power bi .pbix file but I don't see the option to.
How do I attach a file?
- HotChilli6 years agoCommunity Champion
Dropbox or similar and post the link
- data23f6 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