Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello Everyone,
I think I'm having filter context issues! any help or hints would be very much appreciated!
I have this table called Ranking_New_Employee
Team or IA | NET | ranking for seniority | Total | Net to total |
Adam | 329 | New Employee | 2502 | 13% |
Jessica | 236 | New Employee | 879 | 27% |
Ben | 181 | New Employee | 1105 | 16% |
Mark | 164 | New Employee | 905 | 18% |
Dumanowski | 145 | New Employee | 2843 | 5% |
Ewing | 116 | New Employee | 854 | 14% |
Vooys | 104 | New Employee | 2970 | 4% |
Donahue | 82 | New Employee | 912 | 9% |
Mazigi | 70 | New Employee | 451 | 16% |
Gonzalez | 66 | New Employee | 279 | 24% |
Sherwick | 63 | New Employee | 1649 | 4% |
Blaine | 48 | New Employee | 1022 | 5% |
Andrew | 45 | New Employee | 227 | 20% |
Cordel | 40 | New Employee | 1711 | 2% |
Garry | 38 | New Employee | 852 | 4% |
Pelleter | 31 | New Employee | 1305 | 2% |
Catherine | 30 | New Employee | 1008 | 3% |
Dan | 27 | New Employee | 373 | 7% |
Reid | 24 | New Employee | 182 | 13% |
Scott | 19 | New Employee | 116 | 16% |
Christian | 15 | New Employee | 1020 | 1% |
Colin | 10 | New Employee | 236 | 4% |
Steven | 3 | New Employee | 993 | 0% |
I have created this measure to be able to get top 10/bottom10 by Net value.
TOP_New_emp =
VAR raking_asc =
RANKX (
ALL ( 'Ranking_New employee'[NET], 'Ranking_New employee'[Team or IA]),
CALCULATE ( SUM ( 'Ranking_New employee'[NET] ) )
)
VAR ranking_desc =
RANKX (
ALL ( 'Ranking_New employee'[NET], 'Ranking_New employee'[Team or IA]),
CALCULATE ( SUM ( 'Ranking_New employee'[NET] ) ),
,ASC
)
RETURN
SWITCH (
SELECTEDVALUE ( View_New_Employee[Type] ),
"Bottom 10", IF ( ranking_desc <= 10, SUM ('Ranking_New employee'[NET] ),blank()),
"Top 10", IF ( raking_asc <= 10, SUM ( 'Ranking_New employee'[NET]) , blank()
))
This is the result I get when I select top 10. but, of course, when I select bottom10, only the bottom 10 get selected.
Team or IA | Top_New_emp |
Adam | 329 |
Jessica | 236 |
Ben | 181 |
Mark | 164 |
Dumanowski | 145 |
Ewing | 116 |
Vooys | 104 |
Donahue | 82 |
Mazigi | 70 |
Gonzalez | 66 |
*****The Issue starts here*****
Now, I have created this measure to get a % Net to total
but when I drag this measure to the result above, I get this :
Team or IA | Top_New_emp | Net to total |
Adam | 329 | 13% |
Jessica | 236 | 27% |
Ben | 181 | 16% |
Mark | 164 | 18% |
Dumanowski | 145 | 5% |
Ewing | 116 | 14% |
Vooys | 104 | 4% |
Donahue | 82 | 9% |
Mazigi | 70 | 16% |
Gonzalez | 66 | 24% |
Sherwick | 4% | |
Blaine | 5% | |
Andrew | 20% | |
Cordel | 2% | |
Garry | 4% | |
Pelleter | 2% | |
Catherine | 3% | |
Dan | 7% | |
Reid | 13% | |
Scott | 16% | |
Christian | 1% | |
Colin | 4% | |
Steven | 0% |
But, this is the desired result :
Team or IA | Top_New_emp | Net to total |
Adam | 329 | 13% |
Jessica | 236 | 27% |
Ben | 181 | 16% |
Mark | 164 | 18% |
Dumanowski | 145 | 5% |
Ewing | 116 | 14% |
Vooys | 104 | 4% |
Donahue | 82 | 9% |
Mazigi | 70 | 16% |
Gonzalez | 66 | 24% |
I would like the new calculated measure to respect Top_New_emp filter. In other words, I want to get only Net to Total values that correspond to Top_New_emp whether I select Top 10 or Bottom 10.
For example, when I select Top 10, I don't want the underlined values (refer to the table above) to appear.
Thanks in advance
Well, you see only 10 of them not because of any filtering of the underlying table but because the measure returns BLANK for the rest of them. Just use this fact and modify the other measure to also be sensitive to what's been selected in the slicer. That's easier than you think. Add an IF to the measure and display a value only when the first measure, Top_new_emp, is non-blank.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
47 | |
26 | |
19 | |
15 | |
10 |
User | Count |
---|---|
57 | |
50 | |
44 | |
21 | |
19 |