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
ashaikh
Helper III
Helper III

Ticket Open For more than 20 days

Hello,

 

I am creating a Weekly Report in which I want to have a line charts which provides count of ticket open for more than 20 days. The line chart will have last 10 weeks on the X-axis and count of open tickets on Y-axis.

This is how the data looks like:

IDSTART TIMEEND TIMESTATUS
3809/19/17 22:34NULLPending
123310/6/17 17:41NULLPending
130110/9/17 13:12NULLPending
161310/16/17 13:43NULLPending
162810/16/17 17:16NULLPending
165210/17/17 12:35NULLIn Progress
168010/17/17 15:19NULLPending
197010/24/17 9:59NULLIn Progress
201110/24/17 15:38NULLIn Progress
201210/24/17 16:11NULLPending
202910/25/17 9:29NULLIn Progress
217910/27/17 14:22NULLPending
223010/30/17 12:19NULLIn Progress
234011/1/17 8:56NULLIn Progress
234511/1/17 10:55NULLIn Progress
238111/1/17 13:52NULLIn Progress
240111/2/17 10:05NULLIn Progress
245411/2/17 17:33NULLIn Progress
246711/3/17 10:40NULLIn Progress
247011/3/17 10:42NULLIn Progress

 

Now, here how the report should look like is suppose I am creating a report for this week so suppose the count of ticket open is 8 as shown in table below. Then in the graph report should show coresponding count 8

DATA

 

DURATIONCOUNT
12/11/17 - 18/12/1712
19/11/17 - 25/11/178

 

LINE CHART

 

 LineChart1.png 

 

Now, when I create the report for next week i.e. 11/26/17 - 12/2/17 even if the there might be any tickets which showed open for more than 20 days are resolved the count in the last week should remain same.

 

For example: From above line chart there were 8 tickets which were open for more than 20 days. Now in the next week out of 8, 3 tickets were resolved so last week count should still remain same i.e 8 and 5 tickets which are open should move to the 11/26/17- 12/2/17 report.

LineChart2.png

 

 

It will be great if someone can help me with how can I implemen this.

 

 

Thanks in advance

1 ACCEPTED SOLUTION

Hi @ashaikh,

First, you need to create a data table including [Duration], then add a custom column(copy of [Duration]), then split it to two columns [Start] and [End] column. The following is my query statement and 'Date' table.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VYzBDcAgDAN34d0qsSktmQWx/xogFSXKz76zPEah4hMT9PskPmVeztl+DhUE343Oe+IW+5YEXjdkvqphLJmqx0D22Vw=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [Column1]),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "Custom", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Custom.1", "Custom.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom.1", type date}, {"Custom.2", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "Duration"}, {"Custom.1", "Start"}, {"Custom.2", "End"}})
in
    #"Renamed Columns"

Date tableDate table
Then you can create a calculated column using the formula below.

COUNT =
CALCULATE (
    COUNT ( Table1[ID] ),
    FILTER (
        Table1,
        Table1[END TIME] = "NULL"
            && ( Table1[STATUS] = "Pending"
            || Table1[STATUS] = "In Progress"
            || Table1[STATUS] = "New" )
            && Table1[START TIME] >= 'Date'[Start]
            && Table1[START TIME] <= 'Date'[End]
    )
)
    + 0


Finally, you create a table and line chart visualization, you will get expected result as follows.

resultresult

Please download the .pbix file for more details.

Best Regards,
Aneglia


View solution in original post

3 REPLIES 3
v-huizhn-msft
Employee
Employee

Hi @ashaikh,

How to judge is a ticket open is open than 20 days, using Start Time and Status? What's the calculation rules? Please share more details for analyzing.

Best Regards,
Angelia

Open tickets is by Status. The ticket which are in progress or pending or new,

 

The duration is calculated by current date - start date.

 

And yes for all open ticket End Date is blank

Hi @ashaikh,

First, you need to create a data table including [Duration], then add a custom column(copy of [Duration]), then split it to two columns [Start] and [End] column. The following is my query statement and 'Date' table.

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VYzBDcAgDAN34d0qsSktmQWx/xogFSXKz76zPEah4hMT9PskPmVeztl+DhUE343Oe+IW+5YEXjdkvqphLJmqx0D22Vw=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each [Column1]),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Added Custom", "Custom", Splitter.SplitTextByDelimiter("-", QuoteStyle.Csv), {"Custom.1", "Custom.2"}),
    #"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"Custom.1", type date}, {"Custom.2", type date}}),
    #"Renamed Columns" = Table.RenameColumns(#"Changed Type1",{{"Column1", "Duration"}, {"Custom.1", "Start"}, {"Custom.2", "End"}})
in
    #"Renamed Columns"

Date tableDate table
Then you can create a calculated column using the formula below.

COUNT =
CALCULATE (
    COUNT ( Table1[ID] ),
    FILTER (
        Table1,
        Table1[END TIME] = "NULL"
            && ( Table1[STATUS] = "Pending"
            || Table1[STATUS] = "In Progress"
            || Table1[STATUS] = "New" )
            && Table1[START TIME] >= 'Date'[Start]
            && Table1[START TIME] <= 'Date'[End]
    )
)
    + 0


Finally, you create a table and line chart visualization, you will get expected result as follows.

resultresult

Please download the .pbix file for more details.

Best Regards,
Aneglia


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.