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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
v-eqin-msft
Community Support
Community Support

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
v-eqin-msft
Community Support
Community Support

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors