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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Shockedrope
Employee
Employee

Running total per period

I am trying to calculate an open ticket running total. My data looks like this:

Ticket NameOpen DateClosed Date
AB1-1-2015 
CD2-2-20155-2-2015
EF

4-6-2016

 
GH4-8-20188-9-2018
IJ7-10-20197-12-2019
KL10-30-201911-30-2019
MN12-20-20191-15-2020
OP1-17-2020 

 

If a ticket does not have a close date it is considered still open. I am looking for a running total per month or week so that I can create a graph of open tickets over time per period.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

My blog on HR deals with the same problem. Current employees like open tickets

HR-Analytics-Active-Employee-Hire-and-Termination-trend

It needs handling of open dates along with the close date and date dimension.

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

View solution in original post

6 REPLIES 6
Shockedrope
Employee
Employee

Thank you for the suggestions. I was able to find my solution by following this article: https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Ashish_Mathur
Super User
Super User

Hi,

If you want a running total by month, then i can help.  Also, do you want a running total since inception or should the counter reset at the start of each year?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

My blog on HR deals with the same problem. Current employees like open tickets

HR-Analytics-Active-Employee-Hire-and-Termination-trend

It needs handling of open dates along with the close date and date dimension.

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

kentyler
Solution Sage
Solution Sage

If you use a month as a period. Does that define an open ticket as one what was opened before the month, or during the month, but still had not closed by the end of the month ? What if you use a week as a period ? Is the logic the same, but with weeks?
So your count of "open" may vary depending on the time period.

What you have is what they call a "slowly changing dimension"... your service record changes over time and when you want to report on it all you have available is the current version.

 

One possibility is to take snapshots. Decide on a reporting period. Record a data table of tickets that are open at the end of each period and how many days they have been open.

Then you could write reports against that table.

ken.PNG

 

 

 

Power BI is easy to learn, but it has hard parts.
I'm a personal Power Bi Trainer I learn something every time I answer a question

 







Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


VasTg
Memorable Member
Memorable Member

@Shockedrope 

 

Create a new calculated column as below.

 

 

Open? = IF(ISBLANK(Table[Closed Date]),1,0)

 

 

The join the table with date dimension(below) based on Open date.

 

Calendar = CALENDAR(MIN(Table[Open Date]),MAX(Table[Closed Date]))

 

 

Create a visual with month from date dimension and measure from the table

 

Cumulative sum = CALCULATE(SUM(Table[Open?]),FILTER(ALL(Table[Open Date]),Table[Open Date]<=MAX(Table[Open Date])))

 

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn
danextian
Super User
Super User

Hello @Shockedrope ,

 

Try this:

 

Create a calculated calendar table like below:

Dates = 
ADDCOLUMNS (
    CALENDAR ( DATE ( 2015, 1, 1 ), TODAY () ),
    "YYYYMM", FORMAT ( [Date], "YYYYMM" ),
    "Year", YEAR ( [Date] ),
    "Month Name", FORMAT ( [Date], "MMMM" ),
    "Month Number", MONTH ( [Date] )
)

 

Create a relationship single direction one-to-many relationship between Open Date from your fact and the Date from the calculated table.

 

Create this measure 

Open Tickets =
CALCULATE (
    //count of tickets
    COUNTA ( 'Table'[Ticket Name] ),
    //filter tickets opened on or before the max date in the current context
    FILTER (
        ALL ( Dates ),
        Dates[Date] <= MAX ( Dates[Date] )
    ),
    //from the filter above, filter tickets without or with future closed dates
    FILTER (
        ALL ( 'Table'[Closed Date] ),
        'Table'[Closed Date]
            > MAX ( Dates[Date] || ISBLANK ( 'Table'[Closed Date] ) )
    )
)

 

Add YRMO column from the Dates table and Open Tickets Measure to a table visual to test the formula.

Download the sample pbix from here: https://drive.google.com/file/d/1tqLK-aPakHWxxAKr0UwxA2bQjll-gO1T/view?usp=sharing

 

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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