Forum Discussion
Scatter Plot - Highlight data point via Slicer
Hello!
I am building a report that contains football player stastics. I've calculated the percentile each player is within for each of the stats (28 in all) and I'm trying to highlight where the player falls on the scatter chart, compared to the other players, using a slicer selection.
When I select the the player's name from the slicer, all of the other player's data is filtered out. Is there a way where the other player data remains and the selected player is highlighted in another color?
Data after selecting player via slicerData without selecting playerDesired outcome
4 Replies
- JacktheYetiHelper I
Attaching PBIX File for reference: https://drive.google.com/open?id=1A_Mz1usPCqBAYN03XEmf99e_V_ygXfNR
- v-lionel-msftCommunity Support
Hi JacktheYeti ,
Maybe you can use a custom slicer Chiclet Slicer .
Chiclet Slicer Cross Highlighting
You can import the custom slicer from MarketPlace directly.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- JacktheYetiHelper I
Hello v-lionel-msft
Thanks for the reply. I tried the chiclet slicer and unfortunately it still filters out the other data.
I found this blog post online where a gentleman achieved the highlighting affect through some DAX: http://sqljason.com/2018/03/highlighting-scatter-charts-in-power-bi-using-dax.html
It seems like I'd be able to apply the same logic here but I'm not sure how. Do you think it's possible?
Jack
- JacktheYetiHelper I
Hello v-lionel-msft
I've got it almost configured via the instructions from the link I provided earlier. the highlighting works!
I'm gettin tripped up in two areas with some DAX:
1. I'm using the following DAX to highlight a point on the scatter plot when a player name is selected. This works almost perfect, except it seems when the value of 'Search results (51)'[Ballberührungen pro 90 Min.] is zero or less then 1, that value & player is highlighted in addition to the player selected from the slicer when the only data point highlighted should be the player selected from the slicer.Sel_Ballberührungen pro 90 Min. = VAR BallPro90Min =
SUM('Search results (51)'[Ballberührungen pro 90 Min.])
RETURN SUMX(
VALUES(IsSelectedFlag[Flag]),
VAR SelVal =
CALCULATE(SELECTEDVALUE(IsSelectedFlag[Flag]))
Return
SWITCH(
SelVal,
"Y",[ballberuhrungen pro 90 Slicer],
"N",IF(BallPro90Min <> [ballberuhrungen pro 90 Slicer], BallPro90Min - [ballberuhrungen pro 90 Slicer])))
2. The second issue I'm running into is calculating the Rank Percentile. I'm using the following DAX to calculate but it returns 100% for every data point:
SelPercentile_Balberuhr = Divide(RANK.EQ([Sel_Ballberührungen pro 90 Min.],'Search results (51)'[Ballberührungen pro 90 Min.],ASC),COUNTROWS('Search results (51)'))
I've used a similar formula before implementing the highlighting and the percentile was correct (pasting that DAX here for reference)percentile_Ballberührungen pro 90 Min. = Divide(RANK.EQ('Search results (51)'[Ballberührungen pro 90 Min.],'Search results (51)'[Ballberührungen pro 90 Min.],ASC),COUNTROWS('Search results (51)'))
Thanks!
Jack