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

View all the Fabric Data Days sessions on demand. View schedule

Reply
michal_rosa
Frequent Visitor

Calculate count of last completed task only

I have a table listing tasks per project. Each project has the same number of tasks and they can be either Completed or In Progress. The tasks don't have to be completed in order so it is possible for a task list to look for example like that:

Project 1 - 1 - Completed
Project 1 -2 - Completed
Project 1 -3 - In progress
Project 1 - 4 - Completed
Project 1 -5 - In progress
Project 2 - 1 - Completed
Project 2 - 2- In progress
Project 2 - 3- In progress
Project 2 - 4- In progress
Project 2 - 5- Completed
Project 3 - 1 - Completed
Project 3 - 2- In progress
Project 3 - 3- In progress
Project 3 - 4- In progress
Project 3 - 5- Completed


What I am trying to come up with, is a way to show the count of the last completed task. So if I was to chart the above list, it should show as:

1 - 0
2 - 0
3 - 0
4 - 1
5 - 2

 

Any help would be appreciated.

2 REPLIES 2
Anonymous
Not applicable

Hi @michal_rosa ,

Below is my table:

vxiandatmsft_0-1715568666635.png

You can create a project_right to part the text:

Project_right = RIGHT('Table'[Project],1)

and then you can create a measure to achieve this:

Measure = CALCULATE(COUNT('Table'[flag]) , ALLEXCEPT('Table','Table'[Project_right]) , FILTER('Table','Table'[flag] = "Completed"))

The final output is shown in the following figure:

vxiandatmsft_1-1715568779159.png

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

PhilipTreacy
Super User
Super User

Hi @michal_rosa 

 

I'm guessing the example data you've provided isn't a true representation of your real data.

 

The reason I mention this is that if your Tasks are actual numbers, you can use MAX to work out the last completed task. 

 

But if the tasks have names (and are therefore text) you can't use MAX and would need some other way to work out the 'latest' completed task - like a date field.

 

Can you please post a sample of your actual data.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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 Solution Authors
Top Kudoed Authors