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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
JD0963
Helper I
Helper I

Calculate open tickets at the end of the month?

Hi, I am wondering if anyone here can help!

 

I am building a self service reporting tool for the IT Helpdesk. We have an incidents table that has Incident ID, Create Date, Solve Date, Parent Cateory columns.

 

I need to somehow work out how many incidents were open at the end of each month. A ticket is considered open if the [Solve Date] is null, OR the [Solve Date] > end of the month.

 

So for an example, if a ticket was created on April 2nd, 2017 and closed on April 20th, 2017 - this would not be included. If a ticket was created on April 2nd 2017, and closed on May 5th 2017, this would be included for April as it went over the end of the month mark.

 

If a ticket was opened April 2nd 2017, and closed 8th Jul 2017 it would be included for April, May and June.

 

I hope this makes sense? I have looked at similar examples but can't seem to find what I need on here!

 

Many thanks for any help

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

@JD0963,

 

You could create a table below by using DAX to get the result you want.

Date =
ADDCOLUMNS (
    FILTER (
        CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2018, 1, 31 ) ),
        DAY ( [Date] ) = 1
    ),
    "YearMonth", FORMAT ( [Date], "YYYY-MMM" ),
    "OpenTicket", CALCULATE ( COUNT ( Incidents[ID] ) )
        - CALCULATE (
            COUNT ( Incidents[ID] ),
            FILTER ( Incidents, Incidents[SolveDate] < [Date] )
        )
        + CALCULATE (
            COUNT ( Incidents[ID] ),
            FILTER ( Incidents, ISBLANK ( Incidents[SolveDate] ) )
        )
)

Capture.PNGCapture1.PNG

 

Regards,

Charlie Liao

View solution in original post

3 REPLIES 3
v-caliao-msft
Employee
Employee

@JD0963,

 

You could create a table below by using DAX to get the result you want.

Date =
ADDCOLUMNS (
    FILTER (
        CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2018, 1, 31 ) ),
        DAY ( [Date] ) = 1
    ),
    "YearMonth", FORMAT ( [Date], "YYYY-MMM" ),
    "OpenTicket", CALCULATE ( COUNT ( Incidents[ID] ) )
        - CALCULATE (
            COUNT ( Incidents[ID] ),
            FILTER ( Incidents, Incidents[SolveDate] < [Date] )
        )
        + CALCULATE (
            COUNT ( Incidents[ID] ),
            FILTER ( Incidents, ISBLANK ( Incidents[SolveDate] ) )
        )
)

Capture.PNGCapture1.PNG

 

Regards,

Charlie Liao

Anonymous
Not applicable

Hi,

I have the same requirement,but I am working on tabular model with date dimension and fact table that has Open and Close dates.The date table and fact table is joined with Open date(active),CloseDate(inactive).

Now,how can i acheive the same results without creating additional table.Can't we do this in a measure?

JD0963
Helper I
Helper I

Hi, I am wondering if anyone here can help!

 

I am building a self service reporting tool for the IT Helpdesk. We have an incidents table that has Incident ID, Create Date, Solve Date, Parent Cateory columns.

 

I need to somehow work out how many incidents were open at the end of each month. A ticket is considered open if the [Solve Date] is null, OR the [Solve Date] > end of the month.

 

So for an example, if a ticket was created on April 2nd, 2017 and closed on April 20th, 2017 - this would not be included. If a ticket was created on April 2nd 2017, and closed on May 5th 2017, this would be included for April as it went over the end of the month mark.

 

If a ticket was opened April 2nd 2017, and closed 8th Jul 2017 it would be included for April, May and June.

 

I hope this makes sense? I have looked at similar examples but can't seem to find what I need on here!

 

Many thanks for any help

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.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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