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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hi there,
I would like to sum up the Qty values for each MaterialNumber, grouping them by DateToCalculate + LeadTime (weeks).
I mean summing up all the records with the same MaterialNumber for each record, where their DateToCalculate is less than DateToCalculate + LeadTime (number of weeks).
Is it possible to do this in a new column?
I kindly ask for your assistance.
Solved! Go to Solution.
Hi @szmilosz ,
You can create a measure or a calculated column.
Measure:
Measure =
CALCULATE (
SUM ( 'Table'[ZEM33.Qty] ),
FILTER (
ALLSELECTED ( 'Table' ),
[ZEM33.MaterialNumber] = MAX ( 'Table'[ZEM33.MaterialNumber] )
&& [LeadTime] = MAX ( 'Table'[LeadTime] )
&& [DateToCalculate] = MAX ( 'Table'[DateToCalculate] )
)
)
Calculated column:
Column =
CALCULATE (
SUM ( 'Table'[ZEM33.Qty] ),
FILTER (
'Table' ,
[ZEM33.MaterialNumber] = EARLIER( 'Table'[ZEM33.MaterialNumber] )
&& [LeadTime] = EARLIER( 'Table'[LeadTime] )
&& [DateToCalculate] = EARLIER( 'Table'[DateToCalculate] )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @szmilosz ,
You can create a measure or a calculated column.
Measure:
Measure =
CALCULATE (
SUM ( 'Table'[ZEM33.Qty] ),
FILTER (
ALLSELECTED ( 'Table' ),
[ZEM33.MaterialNumber] = MAX ( 'Table'[ZEM33.MaterialNumber] )
&& [LeadTime] = MAX ( 'Table'[LeadTime] )
&& [DateToCalculate] = MAX ( 'Table'[DateToCalculate] )
)
)
Calculated column:
Column =
CALCULATE (
SUM ( 'Table'[ZEM33.Qty] ),
FILTER (
'Table' ,
[ZEM33.MaterialNumber] = EARLIER( 'Table'[ZEM33.MaterialNumber] )
&& [LeadTime] = EARLIER( 'Table'[LeadTime] )
&& [DateToCalculate] = EARLIER( 'Table'[DateToCalculate] )
)
)
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 42 | |
| 41 | |
| 21 | |
| 21 |
| User | Count |
|---|---|
| 150 | |
| 106 | |
| 65 | |
| 36 | |
| 36 |