Forum Discussion
Backlog average age by day
- 1 year ago
Done
C:\Users\Io\Il mio Drive\Cartelle Condivise Support Microsoft\Avg Age
here the result
but you need to identify each ticket uniquely and label it in another column as the same ticket, here the dimension i created, you find everything in the pbix
The measure (it was tough, therefore THANK YOU, so I do not get bored with easy stuff 🙂 )
Nr Days open Tickets =VAR MaxDate =MAX ( 'Calendar'[Date] )VAR NrOfTickets =CALCULATE (DISTINCTCOUNT ( Tickets[TicketName] ),Tickets[StartDate] <= MaxDate,Tickets[Status] = 0,(Tickets[EndDate] > MaxDate|| ISBLANK ( Tickets[EndDate] )),REMOVEFILTERS ( 'Calendar'[Date] ))RETURNDIVIDE (SUMX (VALUES ( 'Calendar'[Date] ),SUMX ('Tickets dim',VAR StartDate =CALCULATE (MIN ( Tickets[StartDate] ),REMOVEFILTERS ( 'Calendar'[Date] ),Tickets[Status] = 0)VAR EndDate =CALCULATE (MIN ( Tickets[EndDate] ),REMOVEFILTERS ( 'Calendar'[Date] ),Tickets[Status] = 0)RETURNIF ('Tickets dim'[Status] = 0&& MaxDate >= StartDate&& (ISBLANK ( EndDate )|| MaxDate < EndDate),INT ( MaxDate - StartDate ) + 1))),NrOfTickets)If it is ok please give kudos and mark it as a solutionThanks!
Nr Days open Tickets =
VAR MaxDate =
MAX ( 'Calendar'[Date] )
VAR MainStartDate =
CALCULATE ( MAX ( Tickets[StartDate] ), REMOVEFILTERS ( 'Calendar' ) )
VAR NrOfTickets =
CALCULATE (
COUNTROWS ( Tickets ),
Tickets[StartDate] <= MaxDate
&& Tickets[EndDate] > MaxDate,
REMOVEFILTERS ( 'Calendar'[Date] )
)
RETURN
DIVIDE (
SUMX (
VALUES ( 'Calendar'[Date] ),
SUMX (
VALUES ( 'Tickets dim'[TicketName] ),
VAR StartDate =
CALCULATE (
MIN ( Tickets[StartDate] ),
REMOVEFILTERS ( 'Calendar'[Date] ),
Tickets[Status] = 0
)
VAR EndDate =
CALCULATE (
MIN ( Tickets[EndDate] ),
REMOVEFILTERS ( 'Calendar'[Date] ),
Tickets[Status] = 0,
NOT ISBLANK ( Tickets[EndDate] )
)
RETURN
IF (
MaxDate < EndDate
&& MaxDate >= StartDate,
INT ( MaxDate - StartDate ) + 1
)
)
),
NrOfTickets
)
If it works, please give kudos and/or marka as a solution
Thanks
This isn't exactly what I'm looking for unfortunately, I need to calculate each day the average age of the tickets.
On the second date on the axis, the ticket A is 2 days old and the ticket B is 1 day old, therefore, 3 days in total. I divide that by by the number of active tickets (2), so the average is 1.5
- FBergamaschi1 year ago
Super User
This is exatcly my result, what are you saying this is not what you are looking for?