Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi there!
I have two tables and would like to sum between the start and end times.
My data is hourly like so:
Table1
Date | Value |
7/18/18 7:00 PM | 1 |
7/18/18 8:00 PM | 1 |
7/18/18 9:00 PM | 1 |
7/18/18 10:00 PM | 1 |
7/19/18 7:00 AM | 2 |
7/19/18 8:00 AM | 2 |
7/19/18 9:00 AM | 2 |
7/19/18 10:00 AM | 2 |
7/19/18 7:00 PM | 3 |
7/19/18 8:00 PM | 3 |
7/19/18 9:00 PM | 3 |
7/19/18 10:00 PM | 3 |
and I would like to sum as so:
Table2
Start | End | Sum |
7/18/2018 7:00:00 PM | 7/19/2018 7:00:00 AM | 4 |
7/19/2018 7:00:00 AM | 7/19/2018 7:00:00 PM | 8 |
7/19/2018 7:00:00 PM | 7/20/2018 7:00:00 AM | 12 |
They are related by Start - Date.
Any thoughts?
Thanks!
Solved! Go to Solution.
@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] )
@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] )
This worked perfectly, thank you. Can you please provide it as a measure too?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |