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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
GuillaumeBDddd
Frequent Visitor

Measure with one to many relationship

Hello, I'm trying to find a way to get by Project, the Sum of Qte per BC from table "Orders". So if a project has a link to a BC, I need to see the total quantity of the BC (See Table below in green).

 

No matter what measure I use, I always get 23 wich is the grand total of table "Orders". (See Table below in red)

 

GuillaumeBDddd_1-1730136768031.png

 

Any idea how to do it with a measure? Here's the model (there are two one to many relationships).

 

GuillaumeBDddd_0-1730136666176.png

Thank you

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @GuillaumeBDddd -you can create a measure that calculates the sum of quantities (Qte) from the "Orders" table, based on the BC value associated with each project in the "Projects" table.

 

Since there’s a Link Table between the "Orders" and "Projects" tables, we’ll need to use it in the measure to filter data correctly.

I hope in your model view the relationships between "Projects" and the Link Table and between "Orders" and the Link Table are active.

check the datatype for BC too in all tables.

 

try below measure :

Total Qte by Project =
CALCULATE(
SUM(Orders[Qte]),
TREATAS(VALUES(Projects[BC]), LinkTable[BC])
)

 

This works, try above calculation. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi @GuillaumeBDddd -you can create a measure that calculates the sum of quantities (Qte) from the "Orders" table, based on the BC value associated with each project in the "Projects" table.

 

Since there’s a Link Table between the "Orders" and "Projects" tables, we’ll need to use it in the measure to filter data correctly.

I hope in your model view the relationships between "Projects" and the Link Table and between "Orders" and the Link Table are active.

check the datatype for BC too in all tables.

 

try below measure :

Total Qte by Project =
CALCULATE(
SUM(Orders[Qte]),
TREATAS(VALUES(Projects[BC]), LinkTable[BC])
)

 

This works, try above calculation. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors