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

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

Reply
Anonymous
Not applicable

Power Bi Last 30 days filter

ais2.JPGdateissue ais.JPG

 

Hi,

 

I have an issue where I have a formula to calculate the days between a submission and then the acceptance of a request.  Off of this, I have an average to get the average number of days overall.  I want to filter this so it only takes into account requests submitted in the last 30 or 60 days for example.

 

I have tried filters but the average number does not change.

 

Can anyone help please?!?!?!

1 REPLY 1
MAwwad
Solution Sage
Solution Sage

 

To filter your average calculation to only include requests submitted in the last 30 or 60 days, you can use a measure with a FILTER function to restrict the data used in the calculation. Here's an example measure that calculates the average number of days between submission and acceptance for requests submitted in the last 30 days:

 

 
Average Days Last 30 Days = VAR Last30Days = CALCULATETABLE('YourTable', DATESBETWEEN('YourTable'[Submission Date], TODAY()-30, TODAY())) RETURN AVERAGEX(FILTER(Last30Days, 'YourTable'[Acceptance Date] <> BLANK()), 'YourTable'[Days Between Submission and Acceptance])
 

This measure first uses the CALCULATETABLE function to filter the data in 'YourTable' to only include requests submitted in the last 30 days. It then uses the FILTER function to further restrict the data to only include requests that have an acceptance date (i.e. the request has been accepted). Finally, it calculates the average number of days between submission and acceptance for the filtered data using the AVERAGEX function.

You can adjust the number of days by changing the second and third arguments of the DATESBETWEEN function. For example, to filter requests submitted in the last 60 days, you would use TODAY()-60 instead.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.