- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Calculating maximum of rolling sum
Hi,
I have a table with the list of article numbers and movement dates - the table is sorted by article number and then, chronologically, by movement dates. Then, in the third column, I have a quanity of article units moved in a given date. In the fourth column, I have a measure called "Rolling" which gives me for each movement date for each article the sum of article units moved in last X days, where X is the average delivery time for each article (in days) + 3 days. The measure is calculated in a following way:
The measure works and gives me the values I want to obtain (see the table below).
ARTICLE_NUMBER | MOVEMENT_DATE | Avg of DELIVERY_TIME | Sum of QUANTITY | Rolling |
1000 | 04.10.2023 00:00 | 10 | -1 | -1 |
1000 | 06.10.2023 00:00 | 10 | -1 | -2 |
1000 | 11.10.2023 00:00 | 10 | -1 | -3 |
1000 | 12.10.2023 00:00 | 10 | -2 | -5 |
1000 | 17.10.2023 00:00 | 10 | -1 | -6 |
1000 | 19.10.2023 00:00 | 10 | -1 | -6 |
1000 | 20.10.2023 00:00 | 10 | -1 | -6 |
1002 | 06.10.2023 00:00 | 5 | -30 | -30 |
1002 | 24.10.2023 00:00 | 5 | -2 | -2 |
1002 | 06.11.2023 00:00 | 5 | -6 | -6 |
1002 | 09.11.2023 00:00 | 5 | -1 | -7 |
1002 | 10.11.2023 00:00 | 5 | -22 | -29 |
1002 | 14.11.2023 00:00 | 5 | -3 | -32 |
1004 | 19.10.2023 00:00 | 5 | -9 | -9 |
1004 | 02.11.2023 00:00 | 5 | -7 | -7 |
1005 | 10.10.2023 00:00 | 5 | -2 | -2 |
1005 | 11.10.2023 00:00 | 5 | -2 | -4 |
1005 | 26.10.2023 00:00 | 5 | -6 | -6 |
1005 | 28.10.2023 00:00 | 5 | -2 | -8 |
1005 | 30.10.2023 00:00 | 5 | -4 | -12 |
What I want to achieve in the next step, is to calculate the minimum (or maximum, if we look at absolute values) of the "Rolling" measure for each article number. Based on the data I provided, I would like to have a following table:
ARTICLE_NUMBER | New_measure |
1000 | -6 |
1002 | -32 |
1004 | -9 |
1005 | -12 |
What should "New_measure" look like?
Many thanks in advance,
Daniel
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @SamInogic ,
unfortunately, the solution you have suggested doesn't work - I simply get blanks as values in the column. Luckily, with help of ChatGPT, I've managed to create a measure that works:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @SamInogic,
Can you please try this:
Min Rolling Per Article =
CALCULATE(
MIN('table_name'[Rolling]),
ALLEXCEPT('table_name', 'table_name'[ARTICLE_NUMBER])
)
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @danielz ,
Try below DAX for new Measure :
This will give you result as :
Thanks!
Inogic Professional Service Division
An expert technical extension for your techno-functional business needs
Power Platform/Dynamics 365 CRM
Drop an email at crm@inogic.com
Service: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @SamInogic ,
unfortunately, the solution you have suggested doesn't work - I simply get blanks as values in the column. Luckily, with help of ChatGPT, I've managed to create a measure that works:

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
08-23-2024 08:39 AM | |||
11-08-2024 08:25 AM | |||
09-02-2024 11:36 AM | |||
Anonymous
| 02-01-2018 06:09 AM | ||
02-20-2017 05:37 AM |
User | Count |
---|---|
23 | |
12 | |
10 | |
9 | |
8 |
User | Count |
---|---|
16 | |
15 | |
15 | |
12 | |
10 |