Forum Discussion
Filtering the table column resulting from a merge
- 4 years ago
Then replace
Duration.Days([CompleteDate]-Start_Date)<=10with
Duration.Days([CompleteDate]-[StartDate])>=0 and Duration.Days([CompleteDate]-[StartDate])<=10
Thanks for the reply.
This solution is functionally equivalent to creating a custom column with definition:
Duration.Days([CompleteDate]-[StartDate])
and then filtering where that column is <= 10.
It doesn't work when there are transactions from previous years relating to the sale because they will have a negative duration and are thus < 10 as well.
I guess the correct way to describe my problem is that for each "sale" I wany to filter them by testing for the existence of a corresponding transaction in the transaction table that occured within 10 days of the completion of the sale. I wanto see a flag which shows which sales met the KPI (transaction within 10 days) and those that did not.
In SQL this is easy, I would use a where exists clause and write a sub query that returns transactions within 10 days of the outer query row. But I am stumped how to replicate such a thing in Power Query.
Then replace
Duration.Days([CompleteDate]-Start_Date)<=10with
Duration.Days([CompleteDate]-[StartDate])>=0 and Duration.Days([CompleteDate]-[StartDate])<=10