Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

caculating through the BOM

Hello Masters

 

I am stucking this for a week , I wonder if someone could  help this out !  I really appreciate !!

 

I have 3 tables as below>

 

BOM table

componentproductqty
1001apple1
1002apple2
1003apple3
1001orange1
1003orange6
1001pear1
1002pear8
1003banana2
1002banana4

 

then I created a new table on unique product list as bridgetable , in order to build relationship with next my Fact table  and get the satistics.

Bridge table

Product
apple
orange
pear
banana

 

all my statstics is on product level  on fact table

productperiodvolume
AppleJan320
AppleFeb650
OrangeJan110
OrangeFeb890
PearJan300
PearFeb400
BananaJan550
BananaFeb300

 

I want to get all the statistics cacualting from the product  level when filtering a component

for example , If I search 1002 , I want to get result on 1002 as below in column " wanted result on component"

componentproductqtyvolume on Productwanted result on Component
1002apple28701740
1002pear87005600
1002banana48503400

 

I tried measure > Sum( facttable{volume}) * sum(BOM{qty} ,  if you could get a correct volume on component level caculated with qty, but the volume from subtotal is wrong.

if I use sumx , it seems there is not relationship on the qty ? 

 

Besides Merging tables from the query editor ( the real data is quite large with a lot of items and volume records , dont want to mutiple the sizes even more ) , is there any other way to do it and cacuate the volume through the qty in BOM ??

 

thanks a lot !!!

Eric

  • Table =
    VAR tmpTable = SUMMARIZE(BOM,BOM[component],BOM[product],"Qty",SUM(BOM[qty]),"Volume",SUM(Sales[volume]))
    VAR tmpTable1 = ADDCOLUMNS(tmpTable,"wanted result on Component",[Qty]*[Volume])
    RETURN tmpTable1

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion
    Table =
    VAR tmpTable = SUMMARIZE(BOM,BOM[component],BOM[product],"Qty",SUM(BOM[qty]),"Volume",SUM(Sales[volume]))
    VAR tmpTable1 = ADDCOLUMNS(tmpTable,"wanted result on Component",[Qty]*[Volume])
    RETURN tmpTable1
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks Greg!