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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AshwinC
Frequent Visitor

Count of days open tickets have been open for - on given date

Hi,

I am trying to build a time series trend report on open tickets and the days it was open at the end of each month.

 

I have already have measure which can calculate the total open tickets at any given date. But the next one is tricky

 

I need to calculate the count of days the ticket was open on a given date. 

 

Then i need to group the Days it was open into 0-10, 10-30, 30+.

 

I need to build a graph to show the trend of how the open ticktets in each group vary over the month.

 

Regards,

Ashwin

 

 

 

7 REPLIES 7
AshwinC
Frequent Visitor

Hi @Shishir22 

 

The sample data of the record id and Open Date and Close date. Some tickets are still open.

 

Record IdOpen DateResolved date
11/01/202215/01/2022
231/01/20224/03/2022
32/03/20223/05/2022
41/04/202215/04/2022
51/05/2022 
631/05/2022 
730/06/20226/08/2022
830/07/2022 
929/08/20226/09/2022
1028/09/2022 
1128/10/20223/11/2022
1227/11/2022 
1327/12/2022 

 

What i am trying to achive here is calculate how many tickets are open at the end of each month and how many days are they are open (Date difference between Open date and End of month Date) and group the days open into categories. The output i am expecting is something as below

 

Open TicketsJanFebMar
0-10124
10-30212
30+011

 

Hopefully this explains.

 

Regards,

Ashwin

 

 

 

 

 

 

 

Hello @AshwinC -  

 

By this- Date difference between Open date and End of month Date

 

Do you mean End of current month date?

 

Thanks,

Shishir

Cheers,
Shishir

Hi @Shishir22 

 

End of the selected month date.

 

For example if a ticket is opened on Jan 1, 2022 and closed on March 15.

 

For Jan the days will Jan 1, 2022 and 31 jan 2022 = 30

For feb the days will be Jan 1, 2022 and 28 Feb 2022 = 58

 

We do not count this at end of march as this has been resolved.

 

Thanks

Hi @AshwinC ,

 

Maybe you can try this expression to do this.

 

Measure =
VAR _1 =
    SUMMARIZE (
        'Table',
        'Table'[Record Id],
        'Table'[Open date],
        'Table'[Resolved date],
        "day",
            IF (
                [Open date] > MAX ( 'calendar'[Date] )
                    || [Resolved date] < MIN ( 'calendar'[Date] ),
                -1,
                IF (
                    ISBLANK ( [Resolved date] )
                        || MAX ( 'calendar'[Date] ) < [Resolved date],
                    MAX ( 'calendar'[Date] ) - [Open date],
                    [Resolved date] - [Open date]
                )
            )
    )
RETURN
    COUNTROWS (
        FILTER (
            _1,
            [day] >= SELECTEDVALUE ( 'Rows'[Min] )
                && [day] <= SELECTEDVALUE ( 'Rows'[Max] )
        )
    )

Result:

vchenwuzmsft_1-1651646337531.png

 

More details please refer the pbix in the end.

 

Best Regards

Community Support Team _ chenwu zhu

 

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

Thanks for the reply.

 

Can you please share the pbix?

 

Ashwin

Hi @AshwinC ,

I forgot to upload the pbix file.

Pbix file in the attachment.

 

Best Regards

Community Support Team _ chenwu zhu

 

Shishir22
Solution Sage
Solution Sage

Hello @AshwinC ,

 

Not very clear. Can you please share sample data and expected result in tabular format?

 

Thanks,

Shishir

Cheers,
Shishir

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Solution Authors
Top Kudoed Authors