topic Re: How to calculate amount on each item based on its share in Desktop
https://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584138#M643280
<P>Thanks for the quick answer. I understood the principle. It seems there is something missing in your formula and I'm trying to solve it.</P>Wed, 06 Jan 2021 10:54:04 GMTemilmaican2021-01-06T10:54:04ZHow to calculate amount on each item based on its share
https://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584091#M643264
<P>Hi,</P><P> </P><P>I have a situation and I can't figure out how to solve it. I hope you can help me.</P><P> </P><P>My model looks like this:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="emilmaican_0-1609928760648.png" style="width: 786px;"><img src="https://community.powerbi.com/t5/image/serverpage/image-id/427685iCA6B8281B0B01A59/image-dimensions/786x154?v=v2" width="786" height="154" role="button" title="emilmaican_0-1609928760648.png" alt="emilmaican_0-1609928760648.png" /></span></P><P> </P><P>Table PRODUCTS sample (there are duplicated values on column ProductId):</P><P>- each product has a total production cost (on column Total cost)</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="emilmaican_1-1609927550384.png" style="width: 400px;"><img src="https://community.powerbi.com/t5/image/serverpage/image-id/427669i00659B9EE6434283/image-size/medium?v=v2&px=400" role="button" title="emilmaican_1-1609927550384.png" alt="emilmaican_1-1609927550384.png" /></span></P><P> </P><P> </P><P>Table RAWMATERIALSHARE sample (there are also duplicated values on column ProductId):</P><P>Each ProductId is made out of several RawMaterials. The split of cost for a certain ProductId by each RawMaterialId is shown on column "RawMaterialShare": </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="emilmaican_2-1609927579002.png" style="width: 400px;"><img src="https://community.powerbi.com/t5/image/serverpage/image-id/427670iCB726FB80418D222/image-size/medium?v=v2&px=400" role="button" title="emilmaican_2-1609927579002.png" alt="emilmaican_2-1609927579002.png" /></span></P><P> </P><P>I need to build a graph/chart showing the cost of each RawMaterialId by year</P><P>The result should be this:</P><TABLE><TBODY><TR><TD>Values</TD><TD>2018</TD><TD>2019</TD><TD>2020</TD><TD>Grand Total</TD></TR><TR><TD>Gold</TD><TD>2000</TD><TD>510</TD><TD>370</TD><TD>2880</TD></TR><TR><TD>Silver</TD><TD>2450</TD><TD>630</TD><TD>440</TD><TD>3520</TD></TR><TR><TD>Platinum</TD><TD>1250</TD><TD>380</TD><TD>230</TD><TD>1860</TD></TR><TR><TD>Copper</TD><TD>300</TD><TD>80</TD><TD>60</TD><TD>440</TD></TR><TR><TD> </TD><TD> </TD><TD> </TD><TD> </TD><TD>8700</TD></TR></TBODY></TABLE><P> </P><P>Thanks</P>Wed, 06 Jan 2021 10:26:46 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584091#M643264emilmaican2021-01-06T10:26:46ZRe: How to calculate the amount of each item based on your share
https://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584120#M643274
<P><A href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/79155" target="_blank">@emilmaican,</A> try a new measure as </P>
<P>sumx(Summarize(RAWMATERIALSHARE, RAWMATERIALSHARE [productid], RAWMATERIALSHARE[rawmaterialid], "_1", sum(PRODUCTS[TotalCost]) * sum(RAWMATERIALSHARE[rawmaterialshare)]),[_1])</P>
<P> </P>
<P> </P>Wed, 13 Jan 2021 11:51:35 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584120#M643274amitchandak2021-01-13T11:51:35ZRe: How to calculate amount on each item based on its share
https://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584138#M643280
<P>Thanks for the quick answer. I understood the principle. It seems there is something missing in your formula and I'm trying to solve it.</P>Wed, 06 Jan 2021 10:54:04 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584138#M643280emilmaican2021-01-06T10:54:04ZRe: How to calculate amount on each item based on its share
https://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584142#M643281
<P>I found the solution. Thank you:</P><P> </P><P> </P><P>CostByRawMaterial =<BR />SUMX (<BR />SUMMARIZE (<BR />RAWMATERIALSHARE,<BR />RAWMATERIALSHARE[productid],<BR />RAWMATERIALSHARE[rawmaterialid],<BR />"_1", SUM ( PRODUCTS[TotalCost] ) * SUM ( RawMaterialShare[RawMaterialShare] )<BR />),<BR />[_1]<BR />)</P>Wed, 06 Jan 2021 10:57:48 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-amount-on-each-item-based-on-its-share/m-p/1584142#M643281emilmaican2021-01-06T10:57:48Z