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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Lukas96
New Member

Many to many relationship calculation for groups of products

Hello guys,

I have this problem. I would like to calculate the bundle price and this is my model.

 

Sales table:

Product name Price

Main Device A10000
Component 1500
Component 2600
Main Device B15000
Component 31000
... 

and I have another table with Bundles which has Many to Many relationship with the table above on Product name = Product name

Parts Product name Bundle Name

Part 1Main Device ABundle A
Part 2Component 1Bundle A
Part 3Component 2Bundle A
Part 1Main Device BBundle B
Part 2Component 1Bundle B
Part 3Component 1Bundle B
Part 4Component 3Bundle B

 

What I want to achieve is to have a Price per Bundle Name. For example Bundle A price is the sum of each components: (Main Device A, Component 1, Component 2) 10000 + 500 + 600 = 11100
for Bundle B it is (Main Device B, Component 1 x2, Component 3) 15000 + 500 + 500 + 1000 = 17 000

I am a bit lost on what should be a DAX code for the price? 

 

3 REPLIES 3
Lukas96
New Member

This is simplified, I have a Price as a measure, what I have in the table sales is Revenue and Qty + I have Customers. Price is then a measure = Divide(Sum(revenue), Sum(Qty)). 
The measure itself is not working for Bundles because for Bundle A for example I dont want to aggregate all the componets within Bundle A. If I aggregate it the Price for Bundle A will be 2 900. But the correct price should be the sum of individual components prices (10 000 +500 + 600 = 11 000)

CustomerProductRevenueUnits
AMain Device A100 00010
AComponent 110 00020
AComponent 2 5 00010
A.......
A.........
 

@Lukas96 

Try to smend [Price] as follows 

Price =
SUMX ( Sales, DIVIDE ( Sales[Revenue], Sales[Qty] ) )

tamerj1
Super User
Super User

Hi @Lukas96 

have tried simple SUM ( Sales[Price] )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.