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
ien
Frequent Visitor

Old ticket backlog evolution over time

Hi,

I have been trying to plot the evolution of old ticket backlog in a chart (i.e. I want to be able to see how many tickets older than X days were open every day, in the past 2 years), and so far I have been able to plot the evolution of all backlog (regardless of its age) in a chart (with DimDate[FullDate] in the X axis) with the following measure:

 

BacklogOverTime = 
IF ( MAX ( 'DimDate'[FullDate]) <= MAX(FactCases[CreatedDate] ),
COUNTROWS (
    FILTER (
        FactCases,
        FactCases[CreatedDate] <= MAX('DimDate'[FullDate])  &&
            ( FactCases[ClosedDate] > MAX('DimDate'[FullDate]) || ISBLANK( FactCases[ClosedDate]))
        )
)
)

 

 

I tried to add another AND condition into the COUNTROWS filter formula like the following (I was trying to only capture tickets older than 120 days), but I am not getting any result when I add it:

 

DATEDIFF(MAX('DimDate'[FullDate]),FactCases[CreatedDate],DAY)>120

 

 

Appreciate any help if anyone is familiar with these types of calculations.

 

Thanks.

 

1 ACCEPTED SOLUTION
ien
Frequent Visitor

I just realized that I was using the last filter wrong, and DATEDIFF needed the 'FactCases'[CreatedDate] first. I'll leave the final formula I came up with here in case it is of use for anyone in the future.

 

BacklogOverTime_120+ = 
IF ( MAX ( 'DimDate'[FullDate]) <= MAX(FactCases[CreatedDate] ),
COUNTROWS (
    FILTER (
        FactCases,
        FactCases[CreatedDate] <= MAX('DimDate'[FullDate]) &&
           DATEDIFF(FactCases[CreatedDate],MAX('DimDate'[FullDate]),DAY)>120 &&
             ( FactCases[ClosedDate] > MAX('DimDate'[FullDate]) || ISBLANK( FactCases[ClosedDate] ))
        )
)
)

 

View solution in original post

1 REPLY 1
ien
Frequent Visitor

I just realized that I was using the last filter wrong, and DATEDIFF needed the 'FactCases'[CreatedDate] first. I'll leave the final formula I came up with here in case it is of use for anyone in the future.

 

BacklogOverTime_120+ = 
IF ( MAX ( 'DimDate'[FullDate]) <= MAX(FactCases[CreatedDate] ),
COUNTROWS (
    FILTER (
        FactCases,
        FactCases[CreatedDate] <= MAX('DimDate'[FullDate]) &&
           DATEDIFF(FactCases[CreatedDate],MAX('DimDate'[FullDate]),DAY)>120 &&
             ( FactCases[ClosedDate] > MAX('DimDate'[FullDate]) || ISBLANK( FactCases[ClosedDate] ))
        )
)
)

 

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.