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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Zyg_D
Continued Contributor
Continued Contributor

using inactive relationship

This is my data:

Tables.JPG

And the relationships (one of them is inactive):

relationships.JPG

When I try to create a ToyColor calculated column in the Toy table I get wrong results:

Inactive_relationship_does_not_work.JPG

Is there a way to use inactive relationship so that the formula gives me Green instead of White?

2 ACCEPTED SOLUTIONS
Icey
Community Support
Community Support

Hi @Zyg_D ,

 

In your data, the ColorID of Cat is 2 and that of Plant is 3. But in table PetToy, when Pet = Cat, Toy = Plant. In the existing relationships, the ColorID will get value like this:

'Toy'[Toy] -> 'PetToy'[Toy] -> 'PetToy'[Pet] -> 'Pet'[Pet] -> 'Pet'[ColorID] -> 'Color'[ColorID].

So, it will return White for Plant.

Tables.JPG

 

It is suggested to make the relationship between 'Pet' and 'Color' inactive, too.

relation.PNG

inactive.PNG

 

 

Best Regards,

Icey

 

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

Zyg_D
Continued Contributor
Continued Contributor

This works without changing any relationship: 

ToyColor = 
CALCULATE (
    MINX (
        Toy,
        RELATED ( Color[Color] )
    ),
    USERELATIONSHIP ( Toy[ColorID], Color[ColorID] ),
    ALLEXCEPT ( Toy, Toy[Toy] )
)

 

View solution in original post

6 REPLIES 6
Zyg_D
Continued Contributor
Continued Contributor

This works without changing any relationship: 

ToyColor = 
CALCULATE (
    MINX (
        Toy,
        RELATED ( Color[Color] )
    ),
    USERELATIONSHIP ( Toy[ColorID], Color[ColorID] ),
    ALLEXCEPT ( Toy, Toy[Toy] )
)

 

Icey
Community Support
Community Support

Hi @Zyg_D ,

 

In your data, the ColorID of Cat is 2 and that of Plant is 3. But in table PetToy, when Pet = Cat, Toy = Plant. In the existing relationships, the ColorID will get value like this:

'Toy'[Toy] -> 'PetToy'[Toy] -> 'PetToy'[Pet] -> 'Pet'[Pet] -> 'Pet'[ColorID] -> 'Color'[ColorID].

So, it will return White for Plant.

Tables.JPG

 

It is suggested to make the relationship between 'Pet' and 'Color' inactive, too.

relation.PNG

inactive.PNG

 

 

Best Regards,

Icey

 

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

Zyg_D
Continued Contributor
Continued Contributor


@Icey wrote:

Hi @Zyg_D ,

 

In your data, the ColorID of Cat is 2 and that of Plant is 3. But in table PetToy, when Pet = Cat, Toy = Plant. In the existing relationships, the ColorID will get value like this:

'Toy'[Toy] -> 'PetToy'[Toy] -> 'PetToy'[Pet] -> 'Pet'[Pet] -> 'Pet'[ColorID] -> 'Color'[ColorID].

So, it will return White for Plant.

Tables.JPG

 

It is suggested to make the relationship between 'Pet' and 'Color' inactive, too.

relation.PNG

inactive.PNG

 

 

Best Regards,

Icey


Hello, Icey. Thank you for digging into my case. I really have not thought about the option to leave both relations inactive. This is the followup question: https://community.powerbi.com/t5/Desktop/Calculated-columns-USERELATIONSHIP-or-LOOKUPVALUE/m-p/11973... 

amitchandak
Super User
Super User

@Zyg_D , Most of these joins are bi-direction make them single direction join from 1 to Many. Unless most needed do not use bi-directional join.

Second, these 1-1 join, try to make them 1-Many join from Dimension/master/lookup to Fact/Transaction data.

 

If they are truly 1-1 then only make them 1-1

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
nvprasad
Solution Sage
Solution Sage

Hi,

Please use the "Userelationship" function to turn inactive relationships to active.

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.
Zyg_D
Continued Contributor
Continued Contributor


@nvprasad wrote:

Hi,

Please use the "Userelationship" function to turn inactive relationships to active.

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

Regards,
N V Durga Prasad


Thanks, but USERELATIONSHIP does not work:

userelationship.JPG

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors