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

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.

Reply
Rickard
Frequent Visitor

Quantity on hand

Hi, 

 

I am trying to visualize quantity on hand, over time, based on transaction history. I am accumulating all historical transactions to get the quantity in stock. 

 

QTY On hand.GIF

Qty on hand 1 year.GIF

 

 

This formula works fine if there are a short period but when looking at several years I need to use filters. 

Qty on hand 6 years.GIF

 

When using a yearly filter the first year of data falls out of the calculation and the quantity on hand gets negative.

 

quantity on hand 2016.GIF

 

Any ideas how to use filters and still capture all transactions?

 

Regards

Rickard Blomqvist

 

2 REPLIES 2
v-sihou-msft
Employee
Employee

@Rickard

 

In this scenario, if you want to calculate the cumulative quantity for all years, your formula is correct. And if the cumulative total at the beginning of a year is negative, you can't avoid displaying negative values when you select a year in slicer to filter data. For your requirement, if you always want to start with positive value in each year. You should use TOTALYTD() instead of using Sum with a cumulative dates filter.

 

Regards,

Hi,

 

@v-sihou-msft Thanks for your answear. TOTALYTD will only work for Profit & Loss, not for the Balance Sheet or for MRP purposes where the opening balance for the current year is the closing balance for the previous year. To view just the TOTALYTD transactions without the opening balance is not that useful. And to visualise 6 years data unfiltered is not that useful either.

 

I guess what I am looking for is equal to TOTALYTD but for all years?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.