Forum Discussion
mgost
1 year agoFrequent Visitor
Multiple relationships between 2 tables
Hi everyone, I really need your help. I am stuck. I need to calculate Amount by User in Document Number, but user can occur in any of three columns - First User, Second User or Third user. I can...
Anonymous
1 year agoNot applicable
Hi,
For the data model:
Can you merge your Delivery Order (Header) table into the Delivery Line Item (Detail) table? That would simplify your model.
If not, you can still use an active relationship on User 1, and inactive relationships on User 2 and User 3 against your User dim table.
Then, for the measures:
Maybe do the User count in your Delivery Order table as a calculated column
And for your question 1 :
That is just a simple summation: SUM(DocDetail[Amount])
For question 2 - Check user name and sum:
SUM using USERELATIONSHIP
For Question 3 - If user count = 3...then divide by 3
You could use a summarized table and wrap that in a SUMX measure to get the result you want. (here i just made a table)