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.
Grieclolu Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
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 |
- Greg_Deckler3 years agoCommunity Champion
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.