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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
trb7fh
Frequent Visitor

Point in Time Comparison

Hello,

 

I've searched the forums for a while and can't find anything that seems to be a match to what I'm doing, but maybe I'm not searching for the right thing.

 

I'm needing to build a visual that will show a count how many open incidents we have on the first of the month for the last 12 months. Open being defined as CREATEDDATE is equal to or before the as-of-date (the 1st of the corresponding month), and RESOLVEDDATE is after the as-of-date or null. If possible, we'd like to count anything with a status of "Reopened" as Open, despite the RESOLVEDDATE showing an earlier value, but these tickets are few enough I believe we can manage without if needed. We'd also like a separate count of the number of tickets Open as of today.

 

I've attached a sample of the (scrubbed) data, which is imported from our database. The table name is CHERWELL_INCIDENT_TRACKING, and it's the only table I have on the report. I don't have any date tables or other items in modeling. Note we are looking for a distinct count, but INCIDENTID is our primary key with each incident having its own row and listed once.

 

Thank you in advance for the help! I know how to build this in my old software but still very new to Power BI.

 

INCIDENTIDCREATEDDATESTATUSLASTMODIFIEDDATERESOLVEDDATEESCALATED
92832810/24/2021Assigned2/18/2022nullYes
93152810/27/2021Assigned4/13/2023nullNo
93153210/27/2021Assigned4/13/2023nullNo
93153610/27/2021Assigned4/13/2023nullNo
92419310/19/2021Assigned10/19/2021nullYes
93245310/27/2021Assigned4/13/2023nullNo
1726810/1/2018Closed5/29/20235/18/2023No
1918510/2/2018Closed9/26/20229/16/2022No
1918710/2/2018Closed10/3/20229/22/2022No
5010011/19/2018Closed10/6/20229/26/2022No
5289911/27/2018Closed8/10/20237/31/2023Yes
1774336/7/2019In Progress3/22/2021nullYes
1864546/19/2019In Progress8/29/2023nullNo
2074787/18/2019In Progress3/22/2021nullYes
92351510/18/2021New10/18/2021nullNo
1346114/8/2019Pending2/23/2022nullYes
1616305/20/2019Pending3/22/2021nullYes
31274011/13/2019Pending8/22/2023nullNo
4195553/26/2020Reopened3/22/20223/18/2022No
8103356/22/2021Reopened2/9/20222/3/2022No
8072586/16/2021Reopened2/9/20222/3/2022No
1283373/29/2019Resolved8/31/20238/31/2023No
94573411/10/2021Resolved8/25/20238/25/2023Yes
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @trb7fh 

 

I've prepared your required output in the power BI data model visualization as shown below.  In Power BI, the best practice is to utilize data model instead of combining in one table all the data.  For this type of requirement where there are two dates columns in a fact table to calculate duration, the standard way to solve is to use a disconnected calendar (date) dable. 

First, I created a separate calendar table by writing the following dax table formula.  

Sakiko_0-1694570960309.png

Additionally, I created a calculated column to distinguish the 1st date in a month and other days in the calendar table (I am sure there's a way to combine this in the table formula above, but I couldn't do it quickly, hence a calculated column was created).  

Sakiko_1-1694571038273.png

The data model looks like below where there are no relationship between the fact table and the calendar table (it's called a disconnected table).  

Sakiko_2-1694571198538.png

In order to express the open items with respect to the time dimension, I've written dax measure like below:

Sakiko_3-1694571311204.png

Additionally, I've written a list of concatenatedXed ID to identify which ID are open at any particular date which can be cross filtered by the month and year matrix table visualization.  

 

Sakiko_4-1694571460670.png

The resultant visualization is as shown below, where you can toggle between 1st day and other slicer to get beginning of the month and end of the month status.  

Sakiko_5-1694571515150.png

I attach the pbix file link below:

CHERWELL_INCIDENT_TRACKING.pbix

BTW, just out of curiosity, is your old system Tableau?  

 

 

View solution in original post

2 REPLIES 2
trb7fh
Frequent Visitor

Hello!

 

I sincerely appreciate the thorough response. Max Date was missed, but I was able to figure it out easily from your test file. I've also included it below in case anyone comes across this thread in the future looking for answers. Otherwise, I was able to recreate it in our file and it works perfectly! I figured a date table would be needed, since the source table was created by an outside source (and all existing in one table), but I'm not very familiar with them and had only seen them as a connected table so I wasn't sure how to go about building for this particular question.

 

The old system from my previous job was Looker.

 

trb7fh_0-1694625692984.png

 

DataNinja777
Super User
Super User

Hi @trb7fh 

 

I've prepared your required output in the power BI data model visualization as shown below.  In Power BI, the best practice is to utilize data model instead of combining in one table all the data.  For this type of requirement where there are two dates columns in a fact table to calculate duration, the standard way to solve is to use a disconnected calendar (date) dable. 

First, I created a separate calendar table by writing the following dax table formula.  

Sakiko_0-1694570960309.png

Additionally, I created a calculated column to distinguish the 1st date in a month and other days in the calendar table (I am sure there's a way to combine this in the table formula above, but I couldn't do it quickly, hence a calculated column was created).  

Sakiko_1-1694571038273.png

The data model looks like below where there are no relationship between the fact table and the calendar table (it's called a disconnected table).  

Sakiko_2-1694571198538.png

In order to express the open items with respect to the time dimension, I've written dax measure like below:

Sakiko_3-1694571311204.png

Additionally, I've written a list of concatenatedXed ID to identify which ID are open at any particular date which can be cross filtered by the month and year matrix table visualization.  

 

Sakiko_4-1694571460670.png

The resultant visualization is as shown below, where you can toggle between 1st day and other slicer to get beginning of the month and end of the month status.  

Sakiko_5-1694571515150.png

I attach the pbix file link below:

CHERWELL_INCIDENT_TRACKING.pbix

BTW, just out of curiosity, is your old system Tableau?  

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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