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
fschnetler
Frequent Visitor

Multiplication across tables

Hello,

I have two simple tables, one which has car components and their prices; and the other has cars, their components and the number of components. They have a relationship at item. 

tables.png

How do I compute the the total price of fixing a Camry? Or just fixing its tyres? The closest I've come is making this matrix.
tables2.png

Any help would be appreciated.

1 ACCEPTED SOLUTION
Seward12533
Solution Sage
Solution Sage

Couple of ways.

Repair Cost SuMX = SUMX(RepairTable,[No]*AVERAGE(CostTable[Price])

But this is costly in terms of resources. I avoid SUMX whenever possible

Add a Calculted Column for Extended Cost in the Repair Table
Extended Cost = RELATED(CostTable[Price])*[No]

Then a measure
Total Cost = SUM( ‘Repair Table’[Extended Cost])

Now build matrix with [Car] and [Total Cost]

View solution in original post

2 REPLIES 2
Seward12533
Solution Sage
Solution Sage

Couple of ways.

Repair Cost SuMX = SUMX(RepairTable,[No]*AVERAGE(CostTable[Price])

But this is costly in terms of resources. I avoid SUMX whenever possible

Add a Calculted Column for Extended Cost in the Repair Table
Extended Cost = RELATED(CostTable[Price])*[No]

Then a measure
Total Cost = SUM( ‘Repair Table’[Extended Cost])

Now build matrix with [Car] and [Total Cost]

The first measure doesn't produce the correct results and I'm not sure why it would use an average. However the second solution works perfectly and was exactly what I was looking for, thank you =).

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.