Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ccjj
Helper I
Helper I

Scatter Plot - Dax options to make selected data point more distinguishable

Hi Community, I have a scatter plot with a measure to highlight a selected data point using this approach:

https://community.powerbi.com/t5/Desktop/Highlight-Scatter-Graph-Based-on-Slicer-Selection/td-p/1144...

 

It solved like 80% of my data points, but I have a concentrated data in a few areas where it does not work.  Tried using category method and a few others, but there is too much overlap in parts of the data.  With regards to the measure below, any way to move the selected value to the front so I can see the Red, or change the size / shape to make the selected value more distinguishable? Thank you!

Red Selected Color = 
IF ( SELECTEDVALUE ( Slicer[Column] ) = SELECTEDVALUE ( Table[Column] ), "Red" )

 

2 ACCEPTED SOLUTIONS

Hi @ccjj ,

I uploaded another pbix using your sample data. The bubble size will change only if customer "AA" is selected. 
https://drive.google.com/file/d/1SYTQ8aVfnWJa3CnM_xI8ND7eUnargsmo/view?usp=sharing










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

Hi @ccjj ,

Here's the updated pbix: https://drive.google.com/file/d/1SYTQ8aVfnWJa3CnM_xI8ND7eUnargsmo/view?usp=sharing 

Please note that there are multiple approaches to removing duplicates and one may be better than the other depending on your use case:

  • Removing duplicates in Power Query
  • Creating a calculated table using DISTINCT function
  • Creating measures that will aggregate just the unique items

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

15 REPLIES 15
danextian
Super User
Super User

Hi @ccjj ,

 

Ther is an option to change the size of the bubbles in the scattergraph.

danextian_0-1650589191796.png


You can use the measure below to dynamically change the bubble size when the selectedvalue is Red

Measure2 =
IF (
    SELECTEDVALUE ( Table[Column] ) = "Red",
    [Orignal Measure] * 3,
    //you can use a different number here
    [Original Measure]
)

If this solution doesn't work for you, please post  a sample pbix so it will be easier for me or other users to provide you with a working solution or one that is closer to your requirements.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Here is my sample pbix

https://www.dropbox.com/s/z6zz5c7lab3j8wj/SampleScatter.pbix?dl=0

in the file, customers "A", "AA", and "AAA" are all overlapping and for some reason, I am unable to dynamically change the bubble size of the RED Selected customer.  thank you!

Thank you!  tried that and it changed my scatter graph to (1) no Fill (2) did not change the size of the datapoint.  Let me see if  I can create some sample data and recreate this in PBI

Hi @ccjj ,

 

After testing myself the formula I initially recommended for the size, it turned out it wouldn't work as plot sizes are just too big.  So I changed it to somethign like IF(SELECTEDVALUE(tbl[column] = "Red", .0000001, 0 ). The bubble size is more doable but could still be too big. I am attaching a pbix which is originally from sqljason - I edited it to somehow work for your requirements.

https://drive.google.com/file/d/18WpSdQsNHJ5SX4C6I-5HQK4xWYcM8viW/view?usp=sharing










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi Danextian, thank you for searching for a solution.  Unfortunately when I tried this, it just makes the bubble size bigger (for all data points), not just the RED, so left with the same problem :(.

 

Have you checked on the attached pbix?










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi Danextian, I tried to replicate the measure to apply to "Size" and it just increases all bubbles and I still am not able to see the "Red" bubble.

 

Measure2 =
IF (
SELECTEDVALUE ( Table[Column] ) = "Red",.00000000000001 ,0)

Hi @ccjj ,

I uploaded another pbix using your sample data. The bubble size will change only if customer "AA" is selected. 
https://drive.google.com/file/d/1SYTQ8aVfnWJa3CnM_xI8ND7eUnargsmo/view?usp=sharing










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi Danextian, 

 

its almost there! 🙂  

Any way to make this Bubble size dynamic based on selected value?  this would only work if I know the duplicate data points.  When dealing with thousands of data points, this becomes problematic.  

 

Also, any way to control the size of the highlighted bubble size (dark blue)

 

Bubble Size =
IF (
SELECTEDVALUE ( CustomerSlicer[Customer] ) = "AA"
&& SELECTEDVALUE ( 'Sample Data'[Customer] ) = "AA",
1,
0
)

Hi @ccjj ,

What do you mean by duplicate data points?
As to the size, they can be calculated dynamically but the bubbles are way too big. Alternatively you can use 0 and blank() instead but the blank will remove the fill and you'll end up with just the border - the bubble size is smaller though.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

hi @danextian 

 

I have a few additional questions.

(1) If I have duplicate data values, is there a way to update the Measure "Sel_Customer" to only get Distinct sums?  I modifed the data to simulate the issue on the pbix.

(2) I have experimented and failed to create a second scatter (tied to the first one) where if I select a "Customer" a second scatter populates the data with ONLY the relevant "Segment" data + the Customer in RED.  For example, when I filter "Customer AA" the second scatter chart populates with Customers with associated "Segment1" in Column "Segment"....so in the result, I should ONLY see Customers A, AA, AA, with "Customer AA" in RED

 

Would love your help...I am stumped! 😞

 

https://www.dropbox.com/s/thothqey846smya/SampleScatter%20change%20size%20when%20selected.pbix?dl=0

 

Hi @ccjj,

What do you mean by distinct sums? If you are referring to Sample data table, you can remove the duplicates using Power Query. Alternatively, you can create a measure that summarizes Column X or Y by customer so you'll get only the  distinct values and then sum it  up.

Sum of Distinct X =
SUMX (
    SUMMARIZE ( 'Sample Data', 'Sample Data'[Customer], 'Sample Data'[X] ),
    'Sample Data'[X]
)
Sum of Distinct Y =
SUMX (
    SUMMARIZE ( 'Sample Data', 'Sample Data'[Customer], 'Sample Data'[Y] ),
    'Sample Data'[Y]
)

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Hi @danextian sorry for my lack of clarity.  I added Duplicate records for "Customer AA" (to similate my dataset) and the scatter no longer highlights the red dot.  Wanted to ask what adjustments I can make? thank you!

 

ccjj_0-1651160721016.png

 

Hi @ccjj ,

Here's the updated pbix: https://drive.google.com/file/d/1SYTQ8aVfnWJa3CnM_xI8ND7eUnargsmo/view?usp=sharing 

Please note that there are multiple approaches to removing duplicates and one may be better than the other depending on your use case:

  • Removing duplicates in Power Query
  • Creating a calculated table using DISTINCT function
  • Creating measures that will aggregate just the unique items

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

That Works!!! Thank you very much!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.