Forum Discussion
Completed date for Projects
- Anonymous4 years ago
Hi aymankh ,
Based on this——how I can create a filter or query which only shows the current-in progress projects and the current completed projects (which may have started anytime before 2022).
Let's assume the "current-in" means the current month( March 2022), so for the data you provided, A, D, E should be shown in visual, right?
Please try to create a flag measure:
Flag = var _startDiff=DATEDIFF(MAX('Table'[Start date ]),TODAY(),MONTH) var _compDiff=DATEDIFF(MAX('Table'[Completed date]),TODAY(),MONTH) return IF(_startDiff=0 && MAX('Table'[Completed date])=BLANK() || MAX('Table'[Completed date])<>BLANK()&& _compDiff=0 ,1,0)And then apply it to visual-filter pane, below is the output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Vijay , I have already tried doing so , however doing so will still give the completed projects which have completed last year , in this table Project C (2021-08-25) which I do want. I only want the pie chart to show the all projects which are in progress and recently completed (Project A and Project D).
In a query step, use the below (Replace #"Changed Type" with your previous step)
=Table.SelectRows(#"Changed Type", each Date.IsInCurrentYear([Completed date]) or [Completed date]="" or [Completed date]=null)