Forum Discussion
calculated column using userelationship
- 9 years ago
Hi Anonymous,
For your screenshot, we can get the username from 'user' table. Becasue the 'user‘ table connect 'Redeem' table indirectly by Discount[discount_materid] and Discount[discount_created]. For example, you can get usename by Discount[discount_created], then you can get Discount[username] in 'Redeem' Table based on Discount[discount_materid] and Redeem[discount_materid]. While your requirement is to get username based on [redeemed_by], the value of Redeem[discount_materid] and Redeem[redeemed_by] are different, so the relationship can not be active.
For your requirement, you can copy a user table(named user1 here), then create a relationship between 'Redeem' and 'user1' table, select user1[username] as value. Please download the file and test.
Best Regards,
Angelia
Hi Anonymous,
The related still works fine as follows. And there is no nessary to create a relationship between table1[user_id] and table3[user_id], tabl1 and table3 can be connected by table2.
when I use related,column is empty....dont know where is the issue.Thank you for your time
Regards
Rishi
- v-huizhn-msft9 years agoMicrosoft Employee
Hi Anonymous,
Your relationship is one-one or one-many relationship? Could you please share your pbix file for further analysis?
Best regards,
Angelia - Anonymous9 years agoNot applicable
I have earlier posted the relations
Table A to Table B -[1----many]-(active connection)[key:user_id]
Table B to Table C -[1----many]- (active connection)[key:gift_id]
Table C to Table A -[many----1]-[key:user_id] (inactive connection).
Regards
Rishi
- v-huizhn-msft9 years agoMicrosoft Employee
Hi Anonymous,
Please create a sample table, so that we can post the solution which is close to your requirement. I totally understand your data is private, you create similar structure fake data for instance.
Best Regards,
Angelia - Anonymous9 years agoNot applicable
Hello v-huizhn-msft
sorry for the delay as I was busy with other module.I have created a sample and I will post the relationships image as well as table required.The username in the fifth column of the table is not correct since the relation is inactive between redeem and user.The username for redeemed_by id=3 is cc not aa.I am also attaching the pbix
Regards
Rishi
- Anonymous9 years agoNot applicable
tables
- v-huizhn-msft9 years agoMicrosoft Employee
Hi Anonymous,
For your screenshot, we can get the username from 'user' table. Becasue the 'user‘ table connect 'Redeem' table indirectly by Discount[discount_materid] and Discount[discount_created]. For example, you can get usename by Discount[discount_created], then you can get Discount[username] in 'Redeem' Table based on Discount[discount_materid] and Redeem[discount_materid]. While your requirement is to get username based on [redeemed_by], the value of Redeem[discount_materid] and Redeem[redeemed_by] are different, so the relationship can not be active.
For your requirement, you can copy a user table(named user1 here), then create a relationship between 'Redeem' and 'user1' table, select user1[username] as value. Please download the file and test.
Best Regards,
Angelia