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.
Dear Power BI Pros,
I have a problem that I cannot find a measure that calculates the material costs per quantity of finished product.
I tried:
I have a fact table with Production order numbers, finished products numbers, their quantity and costs, as well as the material used to produce these finished products, also their quantities (so the quantities of the materials used) and the costs.
A production order always has several lines. One for the product that was produced (the finished product and the quantity) and then the materials that were used.
I know would like to divide the material costs through the quantity of the finished product to get the costs per finished product.
Here is the visual that I would like to finish:
Here is the star scheme and the fact table:
Solved! Go to Solution.
Here's the file with the solution that I was talking about above...
https://1drv.ms/u/s!ApyQEauTSLtOgY8soLaHD-juLe_hYw?e=iGqXso
With some sample data, sure.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Here goes, I hope that helps:
Prod. Order No | Finished Product | Costs Finished Product | Qty Finished Product | Material No | Qty Mterial | Costs Material |
PON-400 | MN-384 | 1 | 0 | |||
PON-400 | MN-383 | 2 | 0 | |||
PON-400 | MN-386 | 4 | 21 | |||
PON-400 | MN-355 | 1 | 1.709 | |||
PON-400 | MN-1093 | 1 | 38 | |||
PON-400 | FP-3 | 1.816 | 5 | |||
PON-401 | MN-384 | 1 | 0 | |||
PON-401 | MN-383 | 5 | 0 | |||
PON-401 | MN-386 | 1 | 21 | |||
PON-401 | MN-355 | 1 | 1.709 | |||
PON-401 | MN-1093 | 1 | 38 | |||
PON-401 | FP-3 | 1.816 | 2 | |||
PON-410 | MN-384 | 8 | 0 | |||
PON-410 | MN-383 | 9 | 0 | |||
PON-410 | MN-386 | 9 | 21 | |||
PON-410 | MN-355 | 9 | 1.709 | |||
PON-410 | MN-1093 | 9 | 38 | |||
PON-410 | FP-3 | 1.820 | 7 |
I managed to change the calculation to:
Here's the file with the solution that I was talking about above...
https://1drv.ms/u/s!ApyQEauTSLtOgY8soLaHD-juLe_hYw?e=iGqXso
Thanks a lot for your help and the file.
I guess the main message is that I need to split the fact table into two, one for the finished products and one for the materials.
Or get my fact table cleaned up so the finished product ID is entered on the same line as the material numbers.
Since it was quicker so slit the fact table, I tried it on the original data and it works 🙂
Thanks for your help!
Create 3 dimensions:
> Order, Product, Material
Create 2 fact tables:
> Order|Product|Prod Qty|Prod Cost
> Order|Product|Material|Material Qty|Material Cost
Join the dims to the facts (1:* with the standard one-way filtering). This way you will have isolated all the dims you need and the fact tables capture 2 processes: the manufacturing of products and the bill of materials needed to manufacture the products. This model will be simpler to calculate what you want. The fact tables will all be hidden since you should NEVER slice by columns in a fact table. Only via dimensions.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |