cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper III

Result last 90 days vs Result between 90 and 180 days

Hi,

I have a table with the number of days to resolve a ticket (Date close ticket - Date open ticket)

I want to calculate the average number of days for the last 90 days.

I have tried with DATESINPERIOD([Date],MAX([Date],-90,DAY)

Also PARALLELPERIOD([Date],0,QUARTER)

But none of these techinique return what I want

And also, how do you return the result for the range between -90 days and -180 days?

Thanks

1 ACCEPTED SOLUTION
Solution Sage

Hi @Surya9 ,

if you use this sample model

and the following measures:

Avg Days = AVERAGE(DaysforTicket[DayforTicket])

Avg Last 90 Days =
VAR MaxDate = MAX('DaysforTicket'[Date])
RETURN
CALCULATE([Avg Days],
'DaysforTicket'[Date]<= MaxDate && 'DaysforTicket'[Date] > MaxDate -91
)

Avg Last 90-180 Days =
VAR MaxDate = MAX('DaysforTicket'[Date])
RETURN
CALCULATE([Avg Days],
'DaysforTicket'[Date]<= MaxDate -90 && 'DaysforTicket'[Date] > MaxDate -180
)

you can get the following result:

5 REPLIES 5
Solution Sage

Please hit the thumbs up & mark it as a solution if it helps you. Thanks.

Solution Sage

Hi @Surya9 ,

if you use this sample model

and the following measures:

Avg Days = AVERAGE(DaysforTicket[DayforTicket])

Avg Last 90 Days =
VAR MaxDate = MAX('DaysforTicket'[Date])
RETURN
CALCULATE([Avg Days],
'DaysforTicket'[Date]<= MaxDate && 'DaysforTicket'[Date] > MaxDate -91
)

Avg Last 90-180 Days =
VAR MaxDate = MAX('DaysforTicket'[Date])
RETURN
CALCULATE([Avg Days],
'DaysforTicket'[Date]<= MaxDate -90 && 'DaysforTicket'[Date] > MaxDate -180
)

you can get the following result:

Community Support

Hi @FredLEGUEN ,

Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

Best Regards,
Community Support Team _ kalyj

Helper III

Hi,

In fact, no, the solution didn't solve my problem. This is why I didn't reply

Resolver III

With in your measure use below measure

FILTER(ALL('Date'),[Date] >=startdt && [Date] <= enddt)
where startdt and and enddt will change based on the criteria
0-90 days or 91 - 180 days