March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Community -
I am working on an Inventory Resource / Materials Resource Planning report and I am struggling to get some of my calculations working.
Data is coming from an ERP system (Sage) and is using Sales order header and detail tables and Bill of material tables.
The sales orders contain Items on order. The Bill of materials tables contains hierarchical data of Item and then N levels of components. I needed to include the sales order data to come up with the Date ranges of orders and quantities of orders. I did a ton of data preparation in the SQL Server tables and with stored procedures.
Essentially I have to come up with materials required from a set of sales orders and bills of materials. I need to subtract current item quantity on hand values from the item level and then each sub item (component). I have the current on hand values in a related table in my power bi model.
I am trying to come up with Quantity ordered by Item Code / Component Item Code Groups. I will then use that value to compare against on hand values to determine if I need to go down to the next component item level.
How would I come up with either a calculated column or measure to get a quantity ordered by Item Code & Component Item Code groupings.
An example of this is here:
In this example , it should be a quantity ordered of
My visual looks like this:
Ultimately the challenge is that the quantities ordered are at the Item level but I need to display inventory and materials required at the Component Item level and filtered by date, product line, and Is Forecast or not.
A copy of my PBIX can be found here: https://drive.google.com/drive/folders/1zyXpvaBYeZQvekOUYcF2EhaSOamkf0Da?usp=sharing
Thank you very much in advance for any help!
Eric
Solved! Go to Solution.
Hi @EricPad ,
Thanks lbendlin for the quick reply. I have some other thoughts to add:
We can create a measure.
Measure =
CALCULATE (
SUM ( tbl_InvetoryResourcePlanning[QuantityOrdered] ),
FILTER (
ALL ( 'tbl_InvetoryResourcePlanning' ),
[ComponentItemCode] = MAX ( 'tbl_InvetoryResourcePlanning'[ComponentItemCode] )
&& [ShipExpireDate]
IN VALUES ( 'tbl_InvetoryResourcePlanning'[ShipExpireDate] )
&& [IsForecastAcct]
IN VALUES ( 'tbl_InvetoryResourcePlanning'[IsForecastAcct] )
&& [ComponentProductLine]
IN VALUES ( 'tbl_InvetoryResourcePlanning'[ComponentProductLine] )
)
)
Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @EricPad ,
Thanks lbendlin for the quick reply. I have some other thoughts to add:
We can create a measure.
Measure =
CALCULATE (
SUM ( tbl_InvetoryResourcePlanning[QuantityOrdered] ),
FILTER (
ALL ( 'tbl_InvetoryResourcePlanning' ),
[ComponentItemCode] = MAX ( 'tbl_InvetoryResourcePlanning'[ComponentItemCode] )
&& [ShipExpireDate]
IN VALUES ( 'tbl_InvetoryResourcePlanning'[ShipExpireDate] )
&& [IsForecastAcct]
IN VALUES ( 'tbl_InvetoryResourcePlanning'[IsForecastAcct] )
&& [ComponentProductLine]
IN VALUES ( 'tbl_InvetoryResourcePlanning'[ComponentProductLine] )
)
)
Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Challenge yourself on the data model
Is this truly reflecting your business scenario? Can you eliminate the bidirectional link? Should some tables be disconnected?
Yes, the data model could be better but some of those tables are carry overs from previous attempts at getting this right.
The main tables I use in my current version are:
tbl_InventoryResourcePlanning
tbl_CI_Items
MeasuresTable (just a holding table for the measures)
The model could be better but the challenge is that the requirement calls for aggregating quantities at the component level while the only way to determine date ranges is at the sales order level.
Sales Order has many lines (and also contains date and if forecast or actual order, which are both slicers/filters)
Each line has an Item with N quantities
Each Item is made up of a Bill of materials
A Bill of materials contains N components each with a certain amount of each required to produce the item
A component on the bill of materials is itself an Item
The Items Table CI Items contains the Product Line (another filter / slicer) and current inventory on hand
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
15 | |
12 | |
9 | |
8 |
User | Count |
---|---|
41 | |
32 | |
29 | |
12 | |
12 |