Forum Discussion
One-to-one wrong filter
- 3 years ago
Grieclolu Right, I used your 2 tables originally, not a single employee in Gender that matches with Terminations. Check it yourself in the updated PBIX attached below signature. Gender3, Table3, Page3.
Dear Greg_Deckler ,
Thank you for your answer. I try to explain better through these two tables.
I uploaded these two tables is PBI and i linked them throuhg a 1-1 relation (ID).
In the report, i would like to see how many terminations i have (second table) per gender, but i doid't get the expected result (as you can see in the screen).
Thanks in advance for your help.
Luca
| Gender | ID |
| Female | 1_1 |
| Female | 10_1 |
| Female | 1000_1 |
| Female | 10023_1 |
| Male | 1004_1 |
| Female | 10045_1 |
| Male | 10061_1 |
| Female | 10072_1 |
| Male | 10089_1 |
| Male | 10093_1 |
| Female | 10098_1 |
| Female | 10110_1 |
| Female | 10118_1 |
| Female | 10126_1 |
| Female | 10128_1 |
| Male | 10137_1 |
| Female | 10138_1 |
| Female | 10140_1 |
| Female | 1015_1 |
| Cluster | ID |
| Voluntary | 1008_1 |
| Involuntary | 10089_2 |
| Voluntary | 10092_1 |
| End of contract | 10118_2 |
| Voluntary | 10137_6 |
| Voluntary | 10165_7 |
| Voluntary | 10239_8 |
| Involuntary | 10244_8 |
| Voluntary | 1030_4 |
| Voluntary | 10332_3 |
| Involuntary | 10360_3 |
| Voluntary | 10389_4 |
| Voluntary | 1040_2 |
| Voluntary | 10421_3 |
| Involuntary | 10445_1 |
Grieclolu OK, so you are getting blanks (unmatched employees) in your visual and you don't want that. So, try creating these measures and put them in your Values instead of Count of ID from you second table.
Male Terminations =
COUNTROWS(
FILTER(
'GenderTable',
[Gender] = "Male" &&
[ID] IN SELECTCOLUMNS('Terminations',"__ID",[ID])
)
)
Female Terminations =
COUNTROWS(
FILTER(
'GenderTable',
[Gender] = "Female" &&
[ID] IN SELECTCOLUMNS('Terminations',"__ID",[ID])
)
)- Grieclolu3 years agoHelper I
Greg_Deckler thanks for your answer, but i would like to automaticall get the result. Of cours the the data i posted are just an example, but the databes is much more big. So, i would like to have a relation that work automatically, since i have an ID for each empoyee and month. So why i can't get the desired result? I'im doing something wrong? Tell me if you need some other data to help me.
Thank you a lot again 🙂
- Greg_Deckler3 years agoCommunity Champion
Grieclolu Because you have a bunch of employees that aren't terminated and thus if you count the rows in the terminations table, there are a bunch of unmatched rows, which results in the legend category of "blank". If you write those two measures, they will always work and you don't have to do anything additional to keep the data up-to-date.
- Grieclolu3 years agoHelper I
Greg_Deckler I understand. Is there any other way ot automatic match the two tables? for example using other type of relation? The problem is that the data base is very big, so you should do this operation for many other cases, for example, age, type of contract, nationality etc. Moreover, i would like to add other tables, with other information, so it will became very difficult to manage everythingh with this measure.
Maybe you can advise me, as i said, another solution in how to put toghether date, or table, or relations.Thanks a lot again,
Luca