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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
maheshwarineha
Frequent Visitor

Power BI relationship not working

An active relationship is there but still not getting the correct no's in report.

projects are connected to projectcontractors - one to many

projectcontractors are connected to contractors - many to one

 

 

 

maheshwarineha_1-1716355294122.png

 

7 REPLIES 7
maheshwarineha
Frequent Visitor

projectID is from project table ID column

contractors = DISTINCTCONT([CONTRACTORS_ID])

But where is contactors id from?  It appears to me that you're aggregating the column from the dimension table. The filter from project will not flow to that table based on the screenshot of the relationship you posted ( which I can no longer find) thus you're seeing the same value for all rows.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Okay I got your point.

 

But how to calculate the contractors for each projectId?

Does the fact table have contractor id? What columns did you use to connector contractor and fact?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Table 1 - projects - contains id

Table 2 - projectcontractors - contains left id and right id

left id is connected with projects id and right id is connected with contractors id

Table 3 - contractors - contains id

 

projects are connected to projectcontractors - one to many

projectcontractors are connected to contractors - many to one

 

Is  one contractor id equivalent  to one right id in table2? If so you can use a distinct count on table 2 right id. Otherwise, you can create a calculated column in  table2 (RELATED(contractors[contractorid]) and do a distinctcount on that calculated column.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @maheshwarineha 

Where are the colums in your visual from?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.