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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Relationsip wrong direction

Hi guys,

 

i have a relation between two tables (highlighted in orange):

 

Unbenannt.PNG

 

At the moment the direction goes from the small table (one side) to the big table (many side). 

 

What i want to do is to sum up values on the many side and display them on the one side. So i would assume the relation should be exactly the other way around. But when i switch the direction to: many-to-one it won't change the direction.

 

So basically my question is how do sum up the values on the many side and write them in the table on the one side?

 

Do i need to switch the direction of the relation for that? 

 

Thx guys

1 ACCEPTED SOLUTION

Yes, you're right, sorry, that was a rookie mistake, I know way better than that - late night brain. As a general rule of thumb, never use a SUM or aggregate measure in a calculated column. Put it in a MEASURE and in the visual instead, or try:

Net order qtd. = CALCULATE(SUM('Proift Contribution'[Net order qtd.])) but MEASURE is preferred. 

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

4 REPLIES 4
AllisonKennedy
Community Champion
Community Champion

For summing the values, no need to switch direction. You can set direction to both or single, but when single you can't change the direction, it always points to the many side. 

@Anonymous  I have updated this post with more accurate info and explanation: 

The issue is with the DAX Context. Calculated columns will calculate the total sum for each row, but a calculated MEASURE will look at the filter context of the report view, so just create a new calculated MEASURE:

Total= SUM(manytable[valuetosum])

Then add the column from the 1 side table to a matrix or table visualization rows, and add the Total MEASURE to the values of the matrix.

 

That's it, the relationship will do the trick. 

 

You can also use a visualization to achieve this result without needing to actually create the DAX calculation, just put the many value in VALUES and the one side table in rows. 

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

@AllisonKennedyThanks for the quick reply! When i do the sum in the one side table it will create a sum but it always creates the same sum for each article: 

 

One side table:

Unbenannt.PNG

 

What should be summed up only should be all the sales for one article in one year (underlined in red) coming from the many side. 

Yes, you're right, sorry, that was a rookie mistake, I know way better than that - late night brain. As a general rule of thumb, never use a SUM or aggregate measure in a calculated column. Put it in a MEASURE and in the visual instead, or try:

Net order qtd. = CALCULATE(SUM('Proift Contribution'[Net order qtd.])) but MEASURE is preferred. 

 

Has this post solved your problem? Please mark it as a solution so that others can find it quickly and to let the community know your problem has been solved. 

 

If you found this post helpful, please give Kudos.

I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 

https://sites.google.com/site/allisonkennedycv


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Perfect it works!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.