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
StillLearning1
Frequent Visitor

Given: Tasks with start date and end date; Need: Count of active tasks per day

Hi, All,

 

I have a table with tasks and start/end dates (example below). My goal is to create a histogram or something that will show the count of active tasks per day, but I can't figure this one out. Any ideas?

 

TaskStartFinish
Learn Power BI1/1/226/1/22
Love Power BI1/1/224/1/22
Hate Power BI3/15/224/15/22

 

So in this case, for 3/30/22, the count would be 3.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @StillLearning1 ;

You could change it.

count_tasks = COUNTROWS(FILTER('Table1',Table1[Current_Start]<=MAX('New'[Date])&&Table1[Current_Finish]>=MIN('New'[Date])))

The final show:

vyalanwumsft_0-1666749503082.png


Best Regards,
Community Support Team _ Yalan Wu
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

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yalanwu-msft
Community Support
Community Support

Hi, @StillLearning1 ;

You could change it.

count_tasks = COUNTROWS(FILTER('Table1',Table1[Current_Start]<=MAX('New'[Date])&&Table1[Current_Finish]>=MIN('New'[Date])))

The final show:

vyalanwumsft_0-1666749503082.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Perfect, thanks!

v-yalanwu-msft
Community Support
Community Support

Hi, @StillLearning1 ;

I tested it in clustered column visual and it right.

vyalanwumsft_0-1666690454667.png

so can you share a simple file ? It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I figured it out actually, just had an typo in my measure.

 

One more question though, when shuffling through the date hierarchy, I notice that for month, quarter, and year it only takes the last day of the time period. E.g. when it's summarized by year, I'm only getting results for tasks on 12/31. Is there anyway to get a count of active tasks for different time periods?

StillLearning1_0-1666737330272.png

 

I updated the dashboard with more relevant data:

 

Given Tasks with start date and end date.pbix
Password: mUavaC7ffR
https://tutorperini.egnyte.com/dl/oBUSgsapXD

StillLearning1
Frequent Visitor

Thanks! I feel like this is going in the right direction, however, when I try to make a chart (column in this case), it doesn't appear to be working. Any ideas? The goal is to have to a chart that shows how many tasks are active on any given day.

 

StillLearning1_0-1666633896926.png

 

v-yalanwu-msft
Community Support
Community Support

Hi, @StillLearning1 ;

You could create a new table .

New = CALENDAR(MIN('Table'[Start]),MAX('Table'[Finish]))

Then create a new measure to count.

count = COUNTROWS(FILTER('Table',[Start]<=MAX('New'[Date])&&[Finish]>=MAX('New'[Date])))

The final show:

vyalanwumsft_0-1666246252433.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.