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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

can't create direct active relationship

 i am trying to create active relationship between two tables . i am getting error you can't create direct active relationship between  Out_Duration_ChildTMC_Affiliate_Final and  Out_RefernceDates because  that would  introduct ambiguity between tables D_scenario  and Out_Duration_ChildTMC_Affiliate_Final . To make this relationshiop active,Deactivate or delete one of the realtionship between _scenario  and Out_Duration_ChildTMC_Affiliate_Final  first.

 

i am trying to  take fixed shipments  value from  Out_Duration_ChildTMC_Affiliate_Fina based on  Affiliate  and ChildTMC.                  

 

Out_RefernceDates

 

Affiliate                  ChildTMC            ID                 LPPYear 

 1002020               LOOF                  898372           2019

 

 

 Out_Duration_ChildTMC_Affiliate_Final

 

 Affiliate                  ChildTMC            ID                 LPPYear   FixedShipments

 1002020               LOOF                  898372           2019             0

 

 

final output refernce :

 

 

Out_RefernceDates

 

Affiliate                  ChildTMC            ID                 LPPYear   FixedShipments

 1002020               LOOF                  898372           2019            0

 

 

 

i have tired with USERELATIONSHIP   function but its not working 

 

XYZ = CALCULATE(SUM(Out_Duration_ChildTMC_Affiliate_Final[Fixed Shipments(Tons)]),USERELATIONSHIP(Out_Duration_ChildTMC_Affiliate_Final[Affiliate],Out_ReferenceDates[Affiliate]))
 

thanks in advance. i am looking   for help . 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

USERRELATIONSHIP function works.

My sample data is as follows.

vstephenmsft_2-1639988063104.png

vstephenmsft_1-1639988055618.png

 

What you need to pay attention to is that your relationship is to be created an inactive relationship, uncheck this option.

vstephenmsft_3-1639988156737.png

 

Measure = CALCULATE(SUM('Out_Duration_ChildTMC_Affiliate_Final'[FixedShipments]),USERELATIONSHIP(Out_Duration_ChildTMC_Affiliate_Final[Affiliate],Out_RefernceDates[Affiliate]))

vstephenmsft_4-1639988332368.png

 

 

Best Regards,

Stephen Tao

 

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

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

Your idea with the userelationship is a good if you are not able to create active relationship. Could you provide more details as to how your measure is not currently working? Additionally it would be good to have some sort of idea about how your data model is structured. Anyway, if you are trying to calculate the fixed shipments based on Affiliate and ChildTMC you could consider making a combined primary key out of these two by using CONCAT either in powerqeury, in your database or within a calculated column. Afterwards you can use this key to create the relationship. 





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

Proud to be a Super User!




Anonymous
Not applicable

@ValtteriN  my measure return wrong value . In both table common value  ChildTMC ,Affiliate.
for example 

Affiliate                  ChildTMC        

1002020                LOOF                   

 

FixedShipments  value  zero  but i have applied measure its return value 17.50 

Anonymous
Not applicable

Hi @Anonymous ,

 

USERRELATIONSHIP function works.

My sample data is as follows.

vstephenmsft_2-1639988063104.png

vstephenmsft_1-1639988055618.png

 

What you need to pay attention to is that your relationship is to be created an inactive relationship, uncheck this option.

vstephenmsft_3-1639988156737.png

 

Measure = CALCULATE(SUM('Out_Duration_ChildTMC_Affiliate_Final'[FixedShipments]),USERELATIONSHIP(Out_Duration_ChildTMC_Affiliate_Final[Affiliate],Out_RefernceDates[Affiliate]))

vstephenmsft_4-1639988332368.png

 

 

Best Regards,

Stephen Tao

 

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

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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