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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Dellis81
Continued Contributor
Continued Contributor

Running inventory with classification change

Hello!   I have a running inventory report in place, but have been requested to include an "age classification" that changes annually, for now assume May 1st.   In the example, start out on Dec 31,2016 with 91 animals, with 9 animals are sold up to April 30th, resulting with 82 animals on inventory April 30th.

 

On May 1st, the age classification changes from 1yr old's to 2yr old;s, and on the May 31st inventory, I would like the report to flip the prior inventory into the new age classification, less the two animals sold in May.

 

The measure I currently have in place is listed below (please note, I am using parameters with the || operator, this appears to be working correctly...

 

End Invty Qty =
CALCULATE (
[Sum of Quantity],
'Consolidated Transactions'[Account] = CropsInStorageMrktAsset
|| 'Consolidated Transactions'[Account] = LivestockMrktAsset,
FILTER (
ALL ( 'CALENDAR'[Date] ),
'CALENDAR'[Date] <= MAX ( 'CALENDAR'[Date] )
)
)
 

Below table is a summary of dates, inventory change, along with the current (wrong) result, and desired result.  As you can see in May, that is where things go wrong.   And that is related to age classification change on May1st.

      
  Current ResultCurrent ResultDesired ResultDesired Result
MonthInvtyChge1+YrOld2+YrOld1+YrOld2+YrOld
Dec-16 91 91 
Jan-17-289 89 
Feb-17-782 82 
Mar-17082 82 
Apr-17082 82 
May-17-282-2 80
Jun-173821 83
 
This final table is a sampling of the fact table 'Consolidated Transactions' as referenced in the above measure.  Quantity represents inventory change.
AccountVendorAmountQuantityDateProdStage
1315Intial StartupBalances1365009112/31/20161+YrOld
1315Source Query: MrktPriceChange-3000-21/31/20171+YrOld
1315Source Query: MrktPriceChange-10500-72/28/20171+YrOld
1315Source Query: MrktPriceChange-3000-25/31/20172+YrOld
1315Source Query: MrktPriceChange450036/30/20172+YrOld


I am hoping this can be resolved with a measure?  Most likely I will have differing "months" for age classification change for various animal groups or crop inventory types - but we can deal with that later?  Thank you in advance for your assistance!

1 REPLY 1
Dellis81
Continued Contributor
Continued Contributor

Ok, I have attached a link to a very simplified data set.   The group 80114A should match the initial explanation.  But, once you see the visual - the displayed inventory, starting in May needs to be shifted over one classification +/- any inventory change.

 

Hope this brings further clarity!

thanks

 

https://drive.google.com/file/d/1hYG3iMrZxobIkcfmf2SoV49YvqGuPtGo/view?usp=sharing

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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