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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors