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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Calculating active issues per month

I have a table with list of issues having columns created date , closed date , status(open/closed) as below

 

ID Created Date             Closed Date                  Status
1 10/9/2021 8:11:22 PM 12/2/2021 9:32:00 PM Closed
2 1/9/2021 8:11:22 PM                                        Open

 

I want to calculate the the list of active issues per month. The list of active issues for a month would be the number of active issues for previous months + number of new issues created for that month - the number of issues closed in that month.
The number of new issues created for that month is the todal number of issues created and uses the created date column
The number of issues closed for that mnth would be the total number of issues closed in that month and uses the closed date column.
Below is a sample data of how 'Active would be calculated

           Jan-22 Feb-22 Mar-22 Apr-22 May-22
New     0          4          30          2          5
Closed 0          0           0           2          3
Active  0          4          34          34        36


Can someone help me how to derive the active data and display in a line chart?

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Please find below a solution approach:

 

Base table:

Mikelytics_5-1667599126349.png

 

 

Data model:

active relationship between DimDate[Date] and Ticket[CreatedDate]

inactive relationship between DimDate[Date] and Ticket[ClosedDate]

Mikelytics_1-1667598692907.png

 

I calculated 4 measures in total:

 

01 New  Tickets = 
COUNTROWS(Tickets)

 

 

 

02 Total Opened Tickets = 

var var_ReferencePeriod = MAX('Dim Date'[Date])

var var_Calculation =
    CALCULATE(
        COUNTROWS(Tickets),
        ALL('Dim Date'),
        Tickets[Created Date] <= var_ReferencePeriod
    )


RETURN

var_Calculation

 

 

 

03 Total Closed Tickets = 

var var_ReferencePeriod = MAX('Dim Date'[Date])

var var_Calculation =
    CALCULATE(
        COUNTROWS(Tickets),
        ALL('Dim Date'),
        Tickets[Closed Date] <= var_ReferencePeriod,
        NOT ISBLANK(Tickets[Closed Date]),
        USERELATIONSHIP('Dim Date'[Date],Tickets[Closed Date])
    )


RETURN

var_Calculation 

 

 

 

04 Active Tickets = 
[02 Total Opened Tickets] - [03 Total Closed Tickets]

 

in the end the trick is to calculate all the amount of historically created tickets - historically closed tickets (based on reference date). This is how you get active tickets to reference date

 

Result in a matrix visual:

Mikelytics_3-1667599006391.png

 

to show the measures in rows please use the formatting functionaliry in the format pane for the matrix

Mikelytics_4-1667599075731.png

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

4 REPLIES 4
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Anonymous,

 

Please find below a solution approach:

 

Base table:

Mikelytics_5-1667599126349.png

 

 

Data model:

active relationship between DimDate[Date] and Ticket[CreatedDate]

inactive relationship between DimDate[Date] and Ticket[ClosedDate]

Mikelytics_1-1667598692907.png

 

I calculated 4 measures in total:

 

01 New  Tickets = 
COUNTROWS(Tickets)

 

 

 

02 Total Opened Tickets = 

var var_ReferencePeriod = MAX('Dim Date'[Date])

var var_Calculation =
    CALCULATE(
        COUNTROWS(Tickets),
        ALL('Dim Date'),
        Tickets[Created Date] <= var_ReferencePeriod
    )


RETURN

var_Calculation

 

 

 

03 Total Closed Tickets = 

var var_ReferencePeriod = MAX('Dim Date'[Date])

var var_Calculation =
    CALCULATE(
        COUNTROWS(Tickets),
        ALL('Dim Date'),
        Tickets[Closed Date] <= var_ReferencePeriod,
        NOT ISBLANK(Tickets[Closed Date]),
        USERELATIONSHIP('Dim Date'[Date],Tickets[Closed Date])
    )


RETURN

var_Calculation 

 

 

 

04 Active Tickets = 
[02 Total Opened Tickets] - [03 Total Closed Tickets]

 

in the end the trick is to calculate all the amount of historically created tickets - historically closed tickets (based on reference date). This is how you get active tickets to reference date

 

Result in a matrix visual:

Mikelytics_3-1667599006391.png

 

to show the measures in rows please use the formatting functionaliry in the format pane for the matrix

Mikelytics_4-1667599075731.png

 

Best regards

Michael

-----------------------------------------------------

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!

@ me in replies or I'll lose your thread.

 

 

 

 

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Anonymous
Not applicable

@Mikelytics . Thank you , your trick for the calculation of active count has worked. 

However I am unable to apply any visual filters to the charts created , any idea what could be the reason or how I can apply the filters. For eg. I would like to filter the issues based on the criticality and want to display only the Critical issues in the chart. 

rratheesh_0-1667712859687.png

 

v-xiaosun-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to your description, I made a sample and here is my solution.

vxiaosunmsft_0-1667556087911.png

Create a DATE table.

DATE = CALENDAR(DATE(2022,1,1),DATE(2022,6,30))

Create two columns to return the month of your "Created Date" and "Closed Date".

month of created = MONTH('test'[Crated Date])
month of closed = MONTH('test'[Closed Date])

Then create two columns to return the "New" and "Closed".

new = CALCULATE(COUNT('test'[month of created]),FILTER('test','test'[month of created]=EARLIER(test[month of created])))
closed = CALCULATE(COUNT('test'[month of closed]),FILTER('test','test'[month of closed]=EARLIER(test[month of closed])&&'test'[Closed Date]<>BLANK()))

Put them into a line chart.

vxiaosunmsft_1-1667556293034.png

 

Best Regards,
Community Support Team _ xiaosun

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Thank you for the response.

I have tried to recreate what you have suggested for a sample data , but I am not getting the desired output.
Please find the attached sample pbix file which I have tried .

https://file.io/0Qy729iKjbsW
Will this solution work if there are months from different years , say 2021 and 2022?
Also what I needed to calculate was the active count for each month which again would be would be the number of active issues for previous months + number of new issues created for that month - the number of issues closed in that month.
Can you please help me to calculate this.
I have attached the desired output that I am looking for. This data corresponds to the sample pbix file attached.

rratheesh_0-1667592960614.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors