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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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