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
medlalami
Helper I
Helper I

Relationship between two tables

Hi all,

 

I created a relation between two tables (Problems and Data), for the following fields : Priority - Urgency - Status

relation.png

The relation is Many-To-One for all fields.

Now when I want to create my Clustered bar chart in my page and wants to display the number of the Problems as values, against the Priority (the field coming from Data table), I got nothing :

visual.png

chart.png

But when I use the Priority field from Problems table, I got the correct result with the total for each priority.

I'm new with Power BI, so maybe I forget something important.

1 ACCEPTED SOLUTION
nvprasad
Solution Sage
Solution Sage

Hi medlalami,

 

You need to create a measure by using  "USERELATIONSHIP" with the calculation function in dax to turn inactive relationships into active relationship.

 

Refer 

https://www.sqlbi.com/articles/using-userelationship-in-dax/

 

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

View solution in original post

10 REPLIES 10
PaulDBrown
Community Champion
Community Champion

If the fields in the “data” table are related (sets and subsets), you don't actually need three relationships. All you need is the one-to-many relationship with the field with the highest granularity in the tables. You can then use whichever field from the dimension table in measures, visuals, slicers etc...

so just make sure the relationship is created with the field with the highest granularity.

 

If the fields are unrelated (independent values) I would recommend you create a separate dimension table for each field.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






aj1973
Community Champion
Community Champion

Hi @medlalami 

I think changing the active relationship to Both will do the work. 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I do it but I got the same result.

nvprasad
Solution Sage
Solution Sage

Hi medlalami,

 

You need to create a measure by using  "USERELATIONSHIP" with the calculation function in dax to turn inactive relationships into active relationship.

 

Refer 

https://www.sqlbi.com/articles/using-userelationship-in-dax/

 

 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

Did I answer your question? Mark my post as a solution! Appreciate your Kudos.
Follow me on LinkedIn.

I will try this solution.

selimovd
Super User
Super User

Hey @medlalami ,

 

which of the 3 relationships is active?

Can you do a double click on the connection and show us?

 

Best regards

Denis

details.png

aj1973
Community Champion
Community Champion

this one is not active

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I can activate this relation, but I need to delete the other ones before. 

I tried to delete the other existing relations, and activated this one > works perfectly, but when I try to relink the other fields (Urgency and Status), I got this message:

relation.png

aj1973
Community Champion
Community Champion

First of all, i don't see the need to add inactive relationships unless you are going to use them for some calculations using UESRELATIOSHIP dax formula. Second keep active the only relatioship that is going to help you with your bar chart.

Third, do you want to share a sample of your file maybe we can better understand the issue? 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

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.