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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ExcellentTalkie
New Member

Distributing Attendance across Time & Sum

Hello all, 

 

I have a list of movie start times and attendance values. There's also a table called "Clock" with a row for every minute of the day. Clock is connected to the movies table by the Time/Start Time. I'd like to determine, using a normal distribution, how many people are arriving at a given time for any movie. 

 

For instance, if I have a table of showtimes like below: 

Start TimeFilmAttendance
5:50Dune 2250
6:00Madame Web50
6:20Dune 2300
6:30One Love100

 

I want to be able to figure out how many people will be arriving for their movie at 6:10, which would potentially include people from all of these showings. 

 

I'd like to create a measure in the Clock table that tells me how many people are arriving at a particular time using a normal distribution function. The mean should be the mean time attendees arrive relative to the start of the movie and the standard deviation being minutes plus or minus that mean. So the mean is "most people show up <x> minutes early/late" and the standard deviation is "most people show up within <x> minutes of the actual start time."

 

 MinutesNorm.Dist
 -3010.93%
 -2021.30%
Mean-1026.60%
Start Time021.30%
 1010.93%
 203.60%
 300.76%
 Total95.42%
   
 MeanSt.Dev
 -1015

 

So I'd like 6:10 to be as follows: 

Start TimeFilmAttendanceMins +/-PercentAttendance
5:50Dune 2250203.60%9
6:00Madame Web501010.93%5
6:20Dune 2300-1026.60%80
6:30One Love100-2021.30%21
      
TimeMeanSt.Dev  Total
6:10-1015  115

 

I rounded the final attendance numbers for simplicity. The result of the measure should be 115. 

 

Is there a way to do this as a measure? 

 

Thanks!

1 REPLY 1
123abc
Community Champion
Community Champion

To accomplish this task in Power BI, you can create a measure in the Clock table that calculates the number of attendees arriving at a particular time using a normal distribution function. Here's how you can do it step by step:

  1. Calculate Mean and Standard Deviation: You have already calculated the mean and standard deviation for the distribution. You can define these values in separate measures in your model.

  2. Create a Measure for Normal Distribution: Now, you need to create a measure that calculates the attendance based on the normal distribution. You can use the NORM.DIST function in DAX to calculate the probability density function at a given point.

  3. Sum Attendance for Each Movie: After calculating the distribution for each movie, you need to sum up the attendance for all the movies that have showtimes around the given time.

Here's how you can implement these steps:

 

Mean = -10
Standard_Deviation = 15

Attendance_Normalized =
VAR ZScore = (Clock[Minutes] - [Mean]) / [Standard_Deviation]
RETURN
NORM.DIST(ZScore, 0, 1, FALSE)

Total_Attendance =
CALCULATE(
SUM('Movies'[Attendance]),
FILTER(
'Movies',
Clock[Start Time] = 'Movies'[Start Time] &&
Clock[Minutes] = 6*HOUR('Movies'[Start Time]) + MINUTE('Movies'[Start Time])
)
)

Total_Attendance_By_Time =
SUMX(
VALUES(Clock),
[Total_Attendance] * [Attendance_Normalized]
)

 

Make sure to replace 'Movies' with the name of your movie table. This measure Total_Attendance_By_Time should give you the total attendance at a specific time based on the normal distribution. You can then use this measure in your visualizations or calculations.

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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