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
aashton
Helper V
Helper V

One-to-many relationships between two tables - Find totals

I have a table Leads, with ID, Email,Name.  This links one-to-many on Lead Type, which is the Type Id and Type Name.  Leads also links to Applications one-to-many with Application data.  I'd like to display Applications by Lead Type.  For example:

Email, Lead Type, Application ID

And even count total applications by Lead Type.  When I put these fields together in a table, it tells me it can't identify a relationship.  This works in SQL, can't figure out why it won't work in Power BI?

10 REPLIES 10
Cbutler
Helper III
Helper III

@aashton can you share your PBIX file? 
or screenshots/examples of the data and relationsip set up? 

@Cbutler I put together a very basic sample pbix.  I'd like to display a lead, with their applications and contracts together in one table.  I am getting an error saying unknown relationship.  I also need to count applications and contracts by lead type, and am having trouble with this.  

 

https://drive.google.com/file/d/1F_Y9zMTOunkCU06T5iterJZct2y7POOX/view?usp=sharing

 

 

My original table structure was Lead Types to Applications many-to-many and Applications to Contracts many-to-many.  So I created the intermediary tables to create one-to-many relationships, thinking I was doing the right thing, but now i can't seem to get anything to work. 

Hi @aashton 

I took a look at your model and it makes much more sense than it would have with a many-to-many.

If you change you relationship between Leads and Lead Types from Cross Filter Direction to Both.

Then a simple measure like App_Cnt = COUNTROWS( 'Applications' ) should work for you if I understand your requirements correctly.

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

@gmsamborn Thanks, I am trying to see Total Applications by Lead type.  And you see in my table example, it just shows the overall total for each type, instead of the total for only that specific type.

aashton_0-1695154695994.png

And I can't put lead, lead type, application data together in one table.

@aashton 

Take a look at my example.  I only changed that 1 relationship to "Both".

 

Leads Sample - mine.pbix

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

@gmsamborn And, do you know how I can display it all together in a table?  Lead name, type, application date, contract date??

Hi @aashton 

I'm not sure why yours would react differently if there are no other slicers/filters in use.

 

As far as not being to put them altogether in one table...  If you look at the relationships in your model, there is no to get from Applications "uphill" to Candidates.

You could make that relationship BOTH as well but I'd be careful about possible unintended consequences.  (I try to avoid relationships with filtering set to BOTH as well as many-to-many relationships whenever possible.)

 

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

@gmsamborn Are you able to put them all together in a table in your example?  I think the only way to do it is change it back to many-to-many.  But that screws other things up.  The Leads, Applications and Contracts table all have dates and states I need to filter on, and I couldn't connect them all to the Date and States table with many-to-many.

Hi @aashton 

Instead of going back to a many-to-many relationship, I would consider changing the relationship to BOTH.

 

You might have to check for possible ambiguity in your model because of this change.  (Check for multiple paths between 2 tables that were made possible by the change.  An example of this in your Model View posted above would be how you can get from  'dim_Date' to 'Application Raw Data' either by the direct relationship OR via 'dim_Date' --> 'Lead Types' --> 'Leads' --> 'Application Raw Data'.)

 

One possible way to get around possible ambiguity in this case might be to make that relationship inactive as well.  This might not be a feasible option since anywhere that a reference to 'Candidates' is made, USERELATIONSHIP() would have to be used.

 

Without seeing your model, I'm just guessing.



Proud to be a Super User!

daxformatter.com makes life EASIER!

@gmsamborn Oh yes, I see.  My actual file does have both as the cross-filter between Leads and Lead Types.  But it's much more complex, there must be something wrong somewhere else:

aashton_0-1695155688669.png

 

 

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.