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
avatar user
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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)