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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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