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
Dear All,
I have a lot of records with the single quantity (eg. warehouse movements) and I would like to publish a line graphic with the total of each week (eg. weekly stock).
My problem is that I only have the weekly movements and not the week stock.
Example:
| Week 1 (begining) | 100 |
| Week 2 | 15 |
| Week 3 | -5 |
| Week 4 | 7 |
| Week 5 | -20 |
| Week 6 | 30 |
| Week 7 | 8 |
| Week 8 | 7 |
| Week 9 | -30 |
| Week 10 | -5 |
If I create a line graph with this data, I get something like below:
This is not what I need beacuse on week 2 my stock was 115 (previous 100 + 15), on week 3 my stock was 110 (previous 115 - 5), on week 4 my stock was 117 (previus 110 + 7), ...
I would like to get a graph like below:
Could anyone give me a tip to obtain the second type of graph?
How could I manage the data?
Thank you
Fabio
Solved! Go to Solution.
Hi @fabio_abbiati ,
The condition after FILTER should use '<=', otherwise the data of the first week will be missing.
Measure =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALL('Table'),
'Table'[WeekNum]<=MAX('Table'[WeekNum])
)
)
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi @fabio_abbiati ,
The condition after FILTER should use '<=', otherwise the data of the first week will be missing.
Measure =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALL('Table'),
'Table'[WeekNum]<=MAX('Table'[WeekNum])
)
)
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
@fabio_abbiati , Assume you have Week No (Whole number too )
Calculate(Sum(Table[Value]), filter(all(Table), Table[Week No] < Max(Table[Week no]) )
If data is across year then use YYYYWW - Week Year column
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 |
|---|---|
| 5 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 10 |