Forum Discussion
One-to-one wrong filter
Hi everyone,
I just uploaded 2 tables:
- the first is related to the company staff ( all the staff with personal ID, for each month with a specific column)
- the second is related to the terminations, stil with personal ID and month
For each of them, i also perfomed a new coulum, where there is a unique code formed by the person id + the month.
With these tables, i settled a one-to-one relationship.
The problem is that this relationship does not work properly, for example: if i want to see how many terminations (information present in the second table) there have been per gender (information present in the first table), PBI is not able to filter it (you cna see it in the screen below).
How can i handle/fix it?
Thanks a lot,
Luca
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.
17 Replies
- Greg_DecklerCommunity Champion
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.- GriecloluHelper I
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_DecklerCommunity 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]) ) )