Forum Discussion

thebestPBI's avatar
thebestPBI
Frequent Visitor
2 years ago
Solved

Stacked chart duplicate ticket in timeline

Hello
I need help from this forum, I have constructed a table with ticket numbers, creation and resolution.

 

 

currently I am trying to make a stacked chart that shows me the ticket all the days it was kept open, by nature the stacked chart does not allow me to do this because it associates the ticket to a date, I have tried to create a calculated table in order to create several lines of the same ticket, but each line contains the dates that the ticket was kept open.

 

 

In the example the visualization I need is the chart 2.

 

  • Hello thebestPBI 

     

    i will try help you achieve what you want .

    assuming that date resolution is the date that the ticket was closed. 

    so example,

    AB ticket,  should be shown from , 02 till 04  . right ? so ab should be displayed for 02, 03 and 04.

     


    if this is the logic  follow these steps : 

     

    step0:  replace null values with todays date . 

    step 0.1  select the column, then replace values  ( found under transform ) 

    step 0.2 replace null with anything . it doesnt matter for now .

     

    step 0.3 select the step from the righ panel. 

     

    step0.4

     

    replace 123 with DateTime.timelocalnow()

    # end M language section 

    -- 

    step1 :  create a datetable ( if not already created )  : you can use this : 

    datetable = CALENDAR("2019-01-01","2025-12-31")
    you can change the static values to get the min and max of the column :  "created" of your table and today() for max .
     
    step 2 : 
    create w new table with this dax code : 
    table23 =
    FILTER(
        CROSSJOIN(
        datetable,
        Table22
        ),
        datetable[Date] >=Table22[Created] && datetable[Date] < Table22[Resolution]
    )
     
     ( in the code,  change the name of the table to your table name )
     
     
    step 3 : link datetable column date to table23 ( the created table in step 2)  on column date .
     

     

    step 4 : 
    create the visual ,  
    with date should read form datetable , ticket and count of tickets should read from the new created table from step2 .

     

     

     

     

     

     

     

    NB : 

    since we replaced null with today, so on the chart,all the tickets that are shown for todays date, are not yet closed.

    because in my assumption, if resolution date  =  05/01/2023 ,  this means closed at this date, thus , it was open at 04/01/2023 . 

     

    but you can modify the  logic of the code to suit your needs. 

     

     

    hope this helps

    best regards

     

3 Replies

  • Daniel29195's avatar
    Daniel29195
    Icon for Community Champion rankCommunity Champion

    Hello thebestPBI 

     

    i will try help you achieve what you want .

    assuming that date resolution is the date that the ticket was closed. 

    so example,

    AB ticket,  should be shown from , 02 till 04  . right ? so ab should be displayed for 02, 03 and 04.

     


    if this is the logic  follow these steps : 

     

    step0:  replace null values with todays date . 

    step 0.1  select the column, then replace values  ( found under transform ) 

    step 0.2 replace null with anything . it doesnt matter for now .

     

    step 0.3 select the step from the righ panel. 

     

    step0.4

     

    replace 123 with DateTime.timelocalnow()

    # end M language section 

    -- 

    step1 :  create a datetable ( if not already created )  : you can use this : 

    datetable = CALENDAR("2019-01-01","2025-12-31")
    you can change the static values to get the min and max of the column :  "created" of your table and today() for max .
     
    step 2 : 
    create w new table with this dax code : 
    table23 =
    FILTER(
        CROSSJOIN(
        datetable,
        Table22
        ),
        datetable[Date] >=Table22[Created] && datetable[Date] < Table22[Resolution]
    )
     
     ( in the code,  change the name of the table to your table name )
     
     
    step 3 : link datetable column date to table23 ( the created table in step 2)  on column date .
     

     

    step 4 : 
    create the visual ,  
    with date should read form datetable , ticket and count of tickets should read from the new created table from step2 .

     

     

     

     

     

     

     

    NB : 

    since we replaced null with today, so on the chart,all the tickets that are shown for todays date, are not yet closed.

    because in my assumption, if resolution date  =  05/01/2023 ,  this means closed at this date, thus , it was open at 04/01/2023 . 

     

    but you can modify the  logic of the code to suit your needs. 

     

     

    hope this helps

    best regards

     

    • thebestPBI's avatar
      thebestPBI
      Frequent Visitor

      Daniel29195  Man, Thank you very much for the help provided, I have tried the solution and it worked the first time, and it was just what I needed. 👏

      • Daniel29195's avatar
        Daniel29195
        Icon for Community Champion rankCommunity Champion

        thebestPBI 

        you 're welcome man. 

        you can always mention me in your posts , and i will be more than happy to assist you as far as i know.