Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 50 | |
| 43 |