Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
NordicS3130
New Member

Running total intelligence to sum data over time periods

Hello,  I have a problem and I am not sure how to begin.  I have a table which has items that I purchased and then sold at a later date.  I would like to use this table to create another table which shows the inventory levels (number of units of each item) that I have on the specific date.  It would take into account the day that the items are purchased, group them by the item name, and have a running total over a period of time.  Ideally the outcome in a new table would look something like the second table below.  Does anyone have a suggestion of how to set this p in power bi?  Thank you very much for your help and suggestions.

 

NordicS3130_1-1724927063530.png

NordicS3130_2-1724927075325.png

 

 

2 ACCEPTED SOLUTIONS
Gabry
Super User
Super User

Hello @NordicS3130 ,
you first need to unpivot your source table, then create a table with dates and use calculated column to count the stock per item.

I made a sample pbix with sofa calculation, you can take a look, let me know

View solution in original post

some_bih
Super User
Super User

Hi @NordicS3130 I created simple file from your column names logic and my data (amounts in measures in single, same currency). I created couple of measures with DAX Calendar table and relationships.

Running Total measure is crucial for running total as dates are different for purchased vs cost. As there are two date columns one column should be used with USERELATIONSHIP in measure

Please not I did not take care of logic that purchase should be lower than cost and vice versa, it is just example.

See enclosed file for details.

some_bih_0-1724937788853.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






View solution in original post

2 REPLIES 2
some_bih
Super User
Super User

Hi @NordicS3130 I created simple file from your column names logic and my data (amounts in measures in single, same currency). I created couple of measures with DAX Calendar table and relationships.

Running Total measure is crucial for running total as dates are different for purchased vs cost. As there are two date columns one column should be used with USERELATIONSHIP in measure

Please not I did not take care of logic that purchase should be lower than cost and vice versa, it is just example.

See enclosed file for details.

some_bih_0-1724937788853.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!






Gabry
Super User
Super User

Hello @NordicS3130 ,
you first need to unpivot your source table, then create a table with dates and use calculated column to count the stock per item.

I made a sample pbix with sofa calculation, you can take a look, let me know

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors