cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PBIFX200
New Member

Respecting filter context Issues, please Help!

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 IANETranking for seniorityTotalNet to total
Adam329New Employee250213%
Jessica236New Employee87927%
Ben181New Employee110516%
Mark 164New Employee90518%
Dumanowski145New Employee28435%
Ewing116New Employee85414%
Vooys104New Employee29704%
Donahue82New Employee9129%
Mazigi70New Employee45116%
Gonzalez66New Employee27924%
Sherwick63New Employee16494%
Blaine48New Employee10225%
Andrew45New Employee22720%
Cordel40New Employee17112%
Garry38New Employee8524%
Pelleter31New Employee13052%
Catherine30New Employee10083%
Dan27New Employee3737%
Reid24New Employee18213%
Scott19New Employee11616%
Christian15New Employee10201%
Colin10New Employee2364%
Steven3New Employee9930%

 

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.

 

unnamed (3).png

Team or IATop_New_emp
Adam329
Jessica236
Ben181
Mark 164
Dumanowski145
Ewing116
Vooys104
Donahue82
Mazigi70
Gonzalez66

 

*****The Issue starts here*****

 

Now, I have created this measure to get a % Net to total

 

unnamed (2).png

 

but when I drag this measure to the result above, I get this :

 

Team or IATop_New_empNet to total
Adam32913%
Jessica23627%
Ben18116%
Mark 16418%
Dumanowski1455%
Ewing11614%
Vooys1044%
Donahue829%
Mazigi7016%
Gonzalez6624%
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 IATop_New_empNet to total
Adam32913%
Jessica23627%
Ben18116%
Mark 16418%
Dumanowski1455%
Ewing11614%
Vooys1044%
Donahue829%
Mazigi7016%
Gonzalez6624%

 

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

1 REPLY 1
daxer-almighty
Solution Sage
Solution Sage

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.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates