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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to calculate the average number of calls in the last 30 days?

Hello there, I have a table that stores each call made. But I want to calculate an average of one users successful calls in the past 30 days. Here is an example of the table below: 

KyleAdam_0-1623143858786.png

It has the start and end dates for each call, and a true or false value for each successful call made, I only want to count the true ones. Is there any way to do this? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , with help from date table

Rolling 30 = CALCULATE(AverageX(values(Table[USerID]),CALCUALTE(countrows(filter(Table,Table[Sucessfulcall]=true())))),DATESINPERIOD('Date'[Date],max('Date'[Date]),-30,Day))

 

 

Join date of date table with date in table without time, if date has time , then create a date column

 

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , with help from date table

Rolling 30 = CALCULATE(AverageX(values(Table[USerID]),CALCUALTE(countrows(filter(Table,Table[Sucessfulcall]=true())))),DATESINPERIOD('Date'[Date],max('Date'[Date]),-30,Day))

 

 

Join date of date table with date in table without time, if date has time , then create a date column

 

Date = [datetime].date
or
Date = date(year([datetime]),month([datetime]),day([datetime]))

 

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you @amitchandak that worked perfectly appreciate it! 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors