cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FlowViz
Helper III
Helper III

Calculating count of values between dates

Hey folks,

 

Need help calculating something between my [Dates] and [WorkItems History] tables in this report.

[Dates] has a list of dates in it, the [WorkItems History] contains history of items, but specifically interested in the InProgressDate and CompletedDate columns.

Screenshot 2022-04-15 at 17.55.41.pngScreenshot 2022-04-15 at 17.54.25.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I want to know on a given date, how many items are InProgress (i.e. not completed) AND how long they have been in progress on a given date, grouped into - <= 1 day, <= 7 days, <= 14 days and > 14 days in progress. I'm trying to recreate these 2 charts:

Screenshot 2022-04-15 at 18.01.48.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PBIX file is here in case it helps - but really could do with some expertise here as I'm stuck 😞 

2 REPLIES 2
parry2k
Super User
Super User

@FlowViz create the relationship between date table and inprogress date columns, if you already have relationship on another column with the date table and then this new relationship will be inactive which is fine, and you can write following measure to make inactive relationship to active to get the count:

 

InProgress Count = 
CALCULATE ( 
   COUNTROWS ( YourTable ),
   USERELATIONSHIP ( YourTable[InProgressDate], DateTable[Date] ) 
)

 

and to visualize, use a column from the date column and above measure. For the 2nd question, check out this dynamic segmentation blog post and you can tweak it to make it work for you.

 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Thanks for the suggestion. That doesn't quite give me what I'm after:

Screenshot 2022-04-16 at 07.11.46.png

It only shows dates where something goes 'InProgress' not the count of how many items are InProgress on a given date...

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors