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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
RCrom
Frequent Visitor

Inactive relationship get data

Hi,

 

I am currently trying out a way to avoid using double tables in my datamodel. So i have been messing arround with inactieve relationships but i cant seem to make it work. I have tried using the related and relationship functions in dax but no succes so far. These are new functions for me so i am not sure how they are properly used. 

 

What i would like to acomplish is the following: As an example i have two tables a name table(customer details) and test table. In the test table i have 2 customer codes, 1 is the billing information and the other is the normal information. But they can also be the same code, however in some situations the codes differs. Now for those i want to be able to see the adress, city and name using the code2 in the test table (the inactive relation). So in a table when i select code2 i would like to display the information for the code 2 not code1. The data is not summed or counted or anything. Its just the information i need. I would like to avoid creating two name tables and duplicating my data. 

 

RCrom_0-1601024347621.png

 

Thx in advance greetings, Robin

 

1 ACCEPTED SOLUTION

Then you should probably use "USERELATIONSHIP"  in measure for Code2 values

 

 

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

https://docs.microsoft.com/en-us/dax/userelationship-function-dax

 

 







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

Proud to be a Super User!




View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@RCrom ,

Not very clear.

 

If you need join on two columns. Create key like this  and join

 

key = [code] & " " [name] in both tables and join key.

 

In case you need to make inactive join active use use relation. Examples

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

 

Hey thx for the reply, i do not wish to join on two colums. I would like to use the use relationship method. But the problem is i am not using a sum or count or anything like that. I just want to switch between relationship and see the code2 as primary key instead of the code1. 

Currently when i am using code1 as primary key it works great, but for example on a differnt graph i would like code2 to be the primary key. 

 

Thx

Then you should probably use "USERELATIONSHIP"  in measure for Code2 values

 

 

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

https://docs.microsoft.com/en-us/dax/userelationship-function-dax

 

 







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

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.