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.
I have some data for deliveries and weight that I would like to aggregate into a rolling sum for each delivery line.
I tried the below code, but it is only presenting the row
This is what I have now for Measure:
LoadWeight Aggregate =
CALCULATE(
SUM('fact HCLoads'[LoadWeight]),
FILTER (
all('fact HCLoads'[DeliveryDateTime].[date]),
'fact HCLoads'[DeliveryDateTime].[Date] >= MIN('fact HCLoads'[DTMinus12].[Date])
&& 'fact HCLoads'[DeliveryDateTime].[DATE] <= MAX('fact HCLoads'[DTPlus12].[DATE]
)))
Load Weight | Delivery Date | Delivery Date -12 | Delivery Date + 12 | Rolling 24 hr sum |
5 | 1/1/2020 0:13 | 12/31/2019 12:13 | 1/1/2020 12:13 | 10 |
5 | 1/1/2020 3:47 | 12/31/2019 15:47 | 1/1/2020 15:47 | 10 |
6 | 1/3/2020 1:57 | 1/2/2020 13:57 | 1/3/2020 13:57 | 6 |
7 | 1/5/2020 1:10 | 1/4/2020 13:10 | 1/5/2020 13:10 | 24 |
8 | 1/5/2020 1:58 | 1/4/2020 13:58 | 1/5/2020 13:58 | 24 |
9 | 1/5/2020 3:01 | 1/4/2020 15:01 | 1/5/2020 15:01 | 24 |
7 | 1/7/2020 1:28 | 1/6/2020 13:28 | 1/7/2020 13:28 | 7 |
Dave
@SuperFave , I have not got it completely.
But try like
CALCULATE(
SUM('fact HCLoads'[LoadWeight]),
FILTER (
all('fact HCLoads'[DeliveryDateTime]),
'fact HCLoads'[DeliveryDateTime] >= MIN('fact HCLoads'[DeliveryDateTime]) -time(24,0,0)
&& 'fact HCLoads'[DeliveryDateTime] <= MAX('fact HCLoads'[DTPlus12].[DATE]
)))
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 |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
145 | |
108 | |
107 | |
89 | |
61 |