Forum Discussion
Help With Event In Progress Visualization
- 5 years ago
Howdy!
Thank you for the apology. 🙂
I found this article that might interest you. But I took a simpler approach to the problem. Here's the code:Events Open in Period = VAR EventsCreated = CALCULATETABLE( VALUES(ft_records[Record_ID]), FILTER( ALL(ft_records), ft_records[Start Date] <= MAX(Date_table[Date]) ) ) VAR EventsPreviouslyClosed = CALCULATETABLE( VALUES(ft_records[Record_ID]), FILTER( ALL(ft_records), ft_records[Finish Date] < MIN(Date_table[Date]) ) ) RETURN COUNTROWS( EXCEPT( EventsCreated, EventsPreviouslyClosed ) )What we're doing here is creating a couple of table variables. The first one is all events opened on or before the last date in a month. The second is all events closed prior to the month in question. I'm working with the assumption that an event will be open - even if only for an instant - if it happened to be closed on the same day. The EXCEPT() function returns rows from one table that are not found in the other, and then we just count the rows. Here's what the result looks like.
I spot checked this in Excel by manually counting records for June and July and it appears accurate. But you should probably check a little more just to be sure.
You can download the PBIX here.
Would it be an accurate statement that what you're looking for is the state of all events that existed in a given time period? Is that what you're after?
Need some clarification as well...your stacked column has three states: created, in progress and closed.
- Created: an event generated during a time period.
- In progress: defined as finish date is blank. May have been created in the current or a prior period.
- Closed: defined as finish date is not blank. May have been created in the current or a prior period.
Your counting seems very strange to me...Created is straight forward. But In Progress and Closed will double count events created this month because an event will either be closed in the current period or carry forward into the next one. Are you sure this is what you're looking for???
- russell805 years ago
Helper III
littlemojopuppy wrote:Would it be an accurate statement that what you're looking for is the state of all events that existed in a given time period? Is that what you're after?
Yes, that's right. Think of it like an IT ticketing system, where each record is a ticket which is created and remains open until it is closed. I want to show for any time period, how many tickets were opened and what tickets theses are, how many were closed and what tickets these are and how many were opened but not closed and what tickets these are. For example, I would like to look back at every day for the last month and for each day be able to see which tickets were created that day, which were closed and which were created some time in the past but are not closed or were closed after that day. I would like to be able to see this on a chart and be able to select a particular day and then select a particular state (created, open, closed) and see the associated records e.g. I want to be able to answer questions like: show me all records which were open on 1st Dec or show me all records which were closed on 4th Dec or show me all records which were created on 29th Nov.
So far we've been able to show all the records (created, open, closed) for a particular time period but we haven't been able to filter that further to show just the created/open/closed by using a visual to filter for them.