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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Carry over Open Tickets from previous months to next month stack graph

I want to carry over all the open tickets from previous months to next month. For example, if I have 20 open tickets in JAN and 3 are closed I want to carry the remaining 17 tickets to FEB and if 3 more tickets that are opened in JAN are closed in the month of FEB then I want to carry over the remaining 14 tickets to MAR.

I want to visualize in the following format but I don't know how to do it(Please click on the link to check on the expected graph).

Stack Graph Visualization 

 

I don't know how to get it in the stacked format, can any please help me in resolving this query or letting me know if this can be done on Power BI.

 

Sharing the sample Data

GroupClosed DateNumberCreated DatePrioritySys Created DateStauts
Group15/24/2019 1:42TIC000014/30/2019 23:053 - Moderate4/30/2019 23:05Closed
Group210/1/2019 13:10TIC000024/25/2019 7:573 - Moderate4/26/2019 10:13Closed
Group17/1/2019 18:29TIC000036/19/2019 6:273 - Moderate6/19/2019 6:27Closed
Group1NULLTIC000045/15/2019 15:513 - Moderate5/15/2019 15:58Open
Group37/16/2019 5:48TIC000057/9/2019 4:182 - High7/9/2019 4:18Assigned
Group3NULLTIC000064/19/2019 16:513 - Moderate4/19/2019 16:51Open
Group37/22/2019 11:17TIC000077/22/2019 11:103 - Moderate7/22/2019 11:10Closed
Group28/2/2019 12:27TIC000085/22/2019 17:063 - Moderate5/22/2019 17:33Closed
Group55/24/2019 1:48TIC000095/17/2019 10:094 - Low5/17/2019 10:09Closed
Group58/1/2019 7:08TIC000107/9/2019 2:032 - High7/9/2019 2:03Closed
Group510/3/2019 21:37TIC000114/18/2019 9:293 - Moderate4/18/2019 9:58Closed
Group1NULLTIC000122/26/2019 10:552 - High2/26/2019 10:55Assigned
Group36/18/2019 11:12TIC000136/18/2019 10:563 - Moderate6/18/2019 10:57Closed
Group4NULLTIC000147/20/2019 5:452 - High7/20/2019 5:45Open
Group210/1/2019 13:16TIC000156/23/2019 22:393 - Moderate6/23/2019 22:46Cancelled
Group2NULLTIC000164/24/2019 23:413 - Moderate4/24/2019 23:50Closed
Group25/16/2019 12:25TIC000174/30/2019 18:472 - High4/30/2019 18:47Cancelled
Group46/10/2019 4:20TIC000186/3/2019 9:343 - Moderate6/3/2019 9:34Cancelled
Group47/9/2019 3:03TIC000195/29/2019 18:212 - High5/29/2019 18:26Closed
Group5NULLTIC000206/5/2019 18:353 - Moderate6/5/2019 18:39Open
Group4NULLTIC000212/5/2019 7:162 - High2/5/2019 7:16Open
Group2NULLTIC000225/10/2019 9:442 - High5/10/2019 9:50Open
Group3NULLTIC000234/22/2019 10:051 - Significant4/22/2019 10:17Open
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous - This is an interesting challenge. Please see attached pbix. The main components of the solution:

  1. Create 2 disconnected date tables.
  2. Create the following measure, which refers to the 2 date tables:
Open Tickets End Of Month = 
var _CreateMonthStartDate = MIN('Created Date'[Date])
var _CreateMonthEndDate = MAX('Created Date'[Date])
var _AsOfMonthEnd = MAX('As Of Date'[Date])
return 
IF(
    _AsOfMonthEnd >=_CreateMonthEndDate,
    COUNTROWS(
        FILTER(
            'Ticket',
            Ticket[Created Date] >= _CreateMonthStartDate &&
            Ticket[Created Date] <= _CreateMonthEndDate &&
            OR(Ticket[Closed Date] > _AsOfMonthEnd, ISBLANK(Ticket[Closed Date]))
        )
    ),
    BLANK()
)

       3. Create a stacked bar chart. Note: The value in the chart corresponds with the size of the band. I don't know of a way to format it as you have in your example.

I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Anonymous - This is an interesting challenge. Please see attached pbix. The main components of the solution:

  1. Create 2 disconnected date tables.
  2. Create the following measure, which refers to the 2 date tables:
Open Tickets End Of Month = 
var _CreateMonthStartDate = MIN('Created Date'[Date])
var _CreateMonthEndDate = MAX('Created Date'[Date])
var _AsOfMonthEnd = MAX('As Of Date'[Date])
return 
IF(
    _AsOfMonthEnd >=_CreateMonthEndDate,
    COUNTROWS(
        FILTER(
            'Ticket',
            Ticket[Created Date] >= _CreateMonthStartDate &&
            Ticket[Created Date] <= _CreateMonthEndDate &&
            OR(Ticket[Closed Date] > _AsOfMonthEnd, ISBLANK(Ticket[Closed Date]))
        )
    ),
    BLANK()
)

       3. Create a stacked bar chart. Note: The value in the chart corresponds with the size of the band. I don't know of a way to format it as you have in your example.

I hope this helps. If it does, please Mark as a solution.
I also appreciate Kudos.
Anonymous
Not applicable

@Anonymous Awesome, Thank you it's working perfectly. I have two questions

1) How did you create the Date Table? I created using the DAX(Example: Date = CALENDAR(Date(2017,1,1),DATE(2020,12,31))) but I wanted to know how you created the Date table

2) The sorting of Months(As of Month)is not in order, I don't know why(let me know if you want the image) 

Anonymous
Not applicable

@Anonymous  -

1. The date table I use is a Power Query (M) script.

2. You can sort a column by another column.Sort by Another Column.PNG

amitchandak
Super User
Super User

Try something like this

 

Open till date = 
Var _min_date_for_open = CALCULATE(maxx(all('Date'[Date Filer]),'Date'[Date Filer]))
Var _Todays_date=CALCULATE(maxx(ALLSELECTED('Date'[Date Filer]),'Date'[Date Filer]))

Var _open_at_start CALCULATE(count(case[case ID]),case[case Date]<=_min_date_for_inventory)
Var   open_till_tody =CALCULATE(count(case[case ID]),filter(case,case[open Date]<=maxx(case,case[open Date].[Date])))
Var   close_till_tody =CALCULATE(count(case[case ID]),filter(case,case[close Date]<=maxx(case,case[close Date].[Date]))) 
//use userelation to change the join to close date
refer
https://community.powerbi.com/t5/Desktop/DATE-RANGE-SLICERS-TO-COMPARE-NETSALES-OF-A-DATE-RANGE/td-p/42251

return
_open_at_start+open_till_tody-close_till_tody

 

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 - https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.