Forum Discussion
nielsvanbruggen
8 years agoRegular Visitor
Filter rows where difference between dates is lower than 31 days
Hello, have a dataset where I want to filter out (or combine) rows when the difference between the enddate of this row and the startdate of another row is lower than 31 days. The dataset look...
Anonymous
8 years agoNot applicable
Dear nielsvanbruggen,
You can create a new column, using this formular:
- StartDate(What you want) = MIN (Table[Startdate], ALLEXCEPT(Table, ClientID))
- EndDate(What you want) = MAX(Table[Enddate], ALLEXCEPT(Table, ClientID))
And all the same ClientID will have same min startDate and max Endate.
Rregards,
ManNVSM.
nielsvanbruggen
8 years agoRegular Visitor
Thanks for all the reactions!
I did create new columns with the DAX-formulas you presented. The problem is that when the enddate in one row is more than 31 days before the startdate of the next row, I want the formula to keep the startdate of that row and use it for the rows to come (for the combination clientid and product.
Is this clear enough? I hope so! :)