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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
NDRS
Frequent Visitor

Help with relationships between tables

Hi All,

 

Probably a basic question coming here.

 

I got 2 tables with a many-to-many relatiohship that i would like to combine with a date-table, but got issues with losing relationships between the tables depening on different scenarios. 

 

Scenario 1:

When relationship looks like this (Many-to-one), my stacked charts works just fine. But my relationship between two colums stop working. 

NDRS_2-1707908193440.png

 

 

NDRS_1-1707908114224.png

NDRS_3-1707910220780.png

 

Scenario 2:

Now I got a Many-to-Many relationship between the two tables, then the table works fine but my stacked chart stopped working.

 

NDRS_5-1707910326464.png

NDRS_6-1707910432727.png

 

NDRS_4-1707910314495.png

 

 

How do I set up the relationships to get both scenarios to work out? 🙂

 

Thanks!

 

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @NDRS 

I'm happy to answer your questions. According to your description, stacked charts work fine when the relationship between tables is Many-to-One; table works fine when the relationship between tables is Many-to-Many. Based on this situation, in Scenario 1, try to create an active relationship for the two tables on the Many side to ensure that DAX in the table can normally read the data in the two tables. If Power BI prompts you that it cannot create an active relationship between the two tables, you can create an inactive relationship and enable this active relationship through the following DAX function:

3.png

DAX:

USERELATIONSHIP(ColumnName1, ColumnName2)

This function specifies an existing relationship to be used in the calculation of a DAX expression and will only work within that expression and will not affect other calculations in the model. You can click on the link below to learn more about the use of USERELATIONSHIP. If this idea helps you, that would be great.

https://dax.guide/userelationship/

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi, @NDRS 

I'm happy to answer your questions. According to your description, stacked charts work fine when the relationship between tables is Many-to-One; table works fine when the relationship between tables is Many-to-Many. Based on this situation, in Scenario 1, try to create an active relationship for the two tables on the Many side to ensure that DAX in the table can normally read the data in the two tables. If Power BI prompts you that it cannot create an active relationship between the two tables, you can create an inactive relationship and enable this active relationship through the following DAX function:

3.png

DAX:

USERELATIONSHIP(ColumnName1, ColumnName2)

This function specifies an existing relationship to be used in the calculation of a DAX expression and will only work within that expression and will not affect other calculations in the model. You can click on the link below to learn more about the use of USERELATIONSHIP. If this idea helps you, that would be great.

https://dax.guide/userelationship/

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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