Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I am new to Power BI and will appreciate any help with my question.
I have a table named 'Datetime' with hour data as shown below:
I have another table 'Info_table' with student information as shown below:
I want to add a new column in the 'Datetime' table which will count the arrivals of students in each hour period as shown below:
Here, 'Arrivals count' is 2 for '1/1/2020 21:00' because student ids 234 and 789 arrived between 21:00 - 22:00 hr as can be seen in the 'Info_table'.
Please let me know how this can be achieved.
Thanks!!
Solved! Go to Solution.
@Anonymous Start with no relationship between the tables. Add a calculated column like:
Arrivals count column =
VAR __StartTime = 'Datetime'[Datetime]
VAR __EndTime = __StartTime + 1/24
VAR __Table = FILTER('Info_table', [Arrival] >= __StartTime && [Arrival] <= __EndTime)
VAR __Result = COUNTROWS(__Table)
RETURN
__Result
@Anonymous Start with no relationship between the tables. Add a calculated column like:
Arrivals count column =
VAR __StartTime = 'Datetime'[Datetime]
VAR __EndTime = __StartTime + 1/24
VAR __Table = FILTER('Info_table', [Arrival] >= __StartTime && [Arrival] <= __EndTime)
VAR __Result = COUNTROWS(__Table)
RETURN
__Result
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.