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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Sum Start End Time Column

Hi there!

 

I have two tables and would like to sum between the start and end times.

 

My data is hourly like so:

 

Table1

DateValue
7/18/18 7:00 PM1
7/18/18 8:00 PM1
7/18/18 9:00 PM1
7/18/18 10:00 PM1
7/19/18 7:00 AM2
7/19/18 8:00 AM2
7/19/18 9:00 AM2
7/19/18 10:00 AM2
7/19/18 7:00 PM3
7/19/18 8:00 PM3
7/19/18 9:00 PM3
7/19/18 10:00 PM3

 

and I would like to sum as so:

 

Table2

StartEndSum
7/18/2018 7:00:00 PM7/19/2018 7:00:00 AM4
7/19/2018 7:00:00 AM7/19/2018 7:00:00 PM8
7/19/2018 7:00:00 PM7/20/2018 7:00:00 AM12

 

They are related by Start - Date.

 

Any thoughts?

 

Thanks!

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may use DAX below to add a calculated column.

Column =
SUMX (
    FILTER ( Table1, Table1[Date] >= Table2[Start] && Table1[Date] < Table2[End] ),
    Table1[Value]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may use DAX below to add a calculated column.

Column =
SUMX (
    FILTER ( Table1, Table1[Date] >= Table2[Start] && Table1[Date] < Table2[End] ),
    Table1[Value]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This worked perfectly, thank you. Can you please provide it as a measure too?

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