Forum Discussion
ThiagoMi88
7 years agoRegular Visitor
Division with filtered field
Hello guys,
I have a table where one column has the products manufactured, in another column the raw materials, but there is also the record of the manufactured product, as you can see below. In t...
- 7 years ago
Hi ThiagoMi88
Create two measures
amount_product = CALCULATE ( SUM ( Table1[Amount] ), FILTER ( ALLEXCEPT ( Table1, Table1[Production Order], Table1[Product] ), LEFT ( Table1[Raw Material], 3 ) = "Pro" ) )Expected result = MAX(Table1[Amount])/[amount_product]
Best Regards
MaggieCommunity Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
7 years agoHi,
This calculated column formula works
=[Amount]/CALCULATE(SUM(Data[Amount]),FILTER(Data,Data[Component]=EARLIER(Data[Product])))
Hope this helps.
- ThiagoMi887 years agoRegular Visitor
First of all,
Thanks for the answers.
I forgot a very important field of the table, "production order".
It can occur in 2 different production orders, used to produce the same product, different amounts of raw material are used.
In this way the amount of raw material used in each production order would be different.
- Ashish_Mathur7 years ago
Super User
Hi,
In another column, Ssow the exact result you are expecting. Also, share your data in a format that can be pasted in an Excel file.
- ThiagoMi887 years agoRegular Visitor
It's ok,
Here is the worksheet