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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ChannelDevMike
Regular Visitor

How to calculate relatedtable properly

Schema:

ChannelDevMike_0-1661195317964.png


I am trying to get quantitiy from Dealer Product and times it by overall in Product Price. The tables are both many to many with eachother so I cant relate them. But they both connect to the Dealer table. 

I was trying to make sumx work with adding a new column in Dealer Product table like this but the sum is destorying the numbers, even when I attempt to then divide by the rows.
 

overall2 = CALCULATE(SUMX(RELATEDTABLE(ProductPrice), ProductPrice[overall]) / COUNTROWS(ProductPrice))

I am stuck trying to combine these columns just for the calulation here
3 REPLIES 3
Anonymous
Not applicable

Hi @ChannelDevMike 

Can you provide a pbix file , so that we can deal with your question easier ?

 

Best Regards,
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It has private info... is there an easy way to change values so I can share? Like a community standard or anything? 

ChannelDevMike
Regular Visitor

More info:
Dealer Product table example:

ChannelDevMike_0-1661196204503.png
Product Price example:
ChannelDevMike_1-1661196213770.png

So I am trying to make overall2 = overall in product price table to then do my quantitiy x overall. 
So in Dealer Product, it should be net = dealerProduct(quantity 50) x productPrice(overall 24) = 1,200 or if I need to make overal2 work, dealerProduct(quantity 50) x dealerProduct(overall2 24) = 1,200

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.