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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
FredLEGUEN
Helper III
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
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

 

if you use this sample model

 

Screenshot 2022-10-10 165249.png 

 

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:

 

 

mangaus1111_0-1665413700781.png

 

View solution in original post

5 REPLIES 5
mangaus1111
Solution Sage
Solution Sage

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

mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

 

if you use this sample model

 

Screenshot 2022-10-10 165249.png 

 

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:

 

 

mangaus1111_0-1665413700781.png

 

v-yanjiang-msft
Community Support
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

Hi,

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

Anonymous
Not applicable

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.