Forum Discussion
Problems combining 2 Tables
Another alternative solution more simpler is:
SumColumnWithDax = CALCULATE(SUM('Fact 1'[SumColumn]),RELATEDTABLE('Fact 2'))
Unfortunately. Also not good....
To make it easier I've stripped + anonymised the problem PBIX; it can be found here: https://ufile.io/sih7r
We want to sum 'paid ftes' from table ftes paid, divided by the number of months, per staffmember. We also want to display a property 'relationtype' from table employment.
- We have to display staffnumber in the visual, otherwise things go wrong
- When we have more than 1 record in 'employment' for an employee in 1 month things go wrong.
So still hoping for THE solution :smileyfrustrated:
- MiKeZZa9 years agoPost Patron
No, staffnumber 111407 has 2 staffids (because of history in our DWH) so when you take staffid in hasonevalue it goes to the 'else' and duplicates for this record.... This happens for a lot of records, so this is not the solution unfortunately...
- MiKeZZa9 years agoPost Patron
That gives:
Table ''costcenter' is configured for row-level security, introducing constraints on how security filters are specified. The setting for Security Filter Behavior on relationship cannot be Both.
- Vvelarde9 years agoCommunity Champion
Hi, Using your sample file:
Staff & FTE Table have more StaffID than Employment.
My doubt is when you put in a table Staff ID & Employment Relation Type only shows the rows with equals StaffIDs in both Tables.
So if Add of FTE Paids the Sum will be different than the total of FTE.
For Example in your file the value 9,106.60 is the total of FTE (with filters applied) but is not the total if add use the employment table. (2081.66= Only StaffIDs in Employment Table)
This result do you want or 9,106.60.
- MiKeZZa9 years agoPost Patron
We want 9106,60 divided by the total number of months, so 9106,60/5 = 1821,32
- Vvelarde9 years agoCommunity Champion
I send you the file.
https://drive.google.com/file/d/0B95C8CKdTZE3Z3RUYldQekdQVVk/view?usp=sharing
I hope will be helpful to another members in find the solution.