Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
erche3
Helper I
Helper I

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

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

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

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

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

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.