Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
aymankh
Regular Visitor

Completed date for Projects

Hi,

For the table (dummy values) shown below 

I am trying to create a pie chart for a list of projects which are in progress or completed. I am facing an issue in doing the same since I want the pie chart for the current date, however the issue is there are projects which have been in progress since last year and completed recently which do not show up in the pie chart.

If I put a start date filter > 2021 it will only  show completed projects and in progress after 2021 and If I put the completed filter> 2021 , it will only show the completed projects. If I remove the filter it will show me all the projects which got completed in 2021 and 2022 as well as the in progress projects.

Can some one guide 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). 

I hope the query is clear to be answered.  

Example 

ProjectStart date Completed dateStatus
 Project A2021-08-212022-03-24Completed
 Project B 2021-08-23 In-Progress
 Project C 2021-08-222021-08-25Completed
 Project D2022-01-202022-03-24Completed
 Project E2022-03-22 In-Progress

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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:

Eyelyn9_0-1648521606120.png

 

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.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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:

Eyelyn9_0-1648521606120.png

 

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 Eyelyn9,

 

Thank you for the detailed visual , let me try and see if this works and respond back on this . This should capture all in progress projects as well as projects which were assigned last year but got completed for this month say March which you dod correctly point out 

aymankh
Regular Visitor

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)

 

Vijay_A_Verma
Super User
Super User

I believe Status column is already giving this info. If this column is not there-

Apply filter on Completed as Non Blanks - Completed

Apply filter on Completed as Blanks - In progress

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors