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

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.

Reply
xzhang32
Regular Visitor

Scatter plot with two nominal variables

I have a data set that contains three columns -- Sample ID (1 to 100), Experiment ID, and Result (between 0 to 1).

Capture.PNG

 

I would like to plot a scatter plot, x axis as Experiment ID, y axis as Sample ID, and the Resultwill be represented by color grade. Demo plot from other programs is given as following.

demo.png

Could you please show me how to plot that in Power BI? Power BI tends to group the Sample IDand Experiment ID, and choose the details as Experiment ID seems not get what I want. Any hint or instruction will be helpful, thank you!

 

Capture2.PNG

1 ACCEPTED SOLUTION
kevcurtis
Advocate I
Advocate I

Hi @xzhang32,

 

First, ensure when connecting/importing your data that each column has the correct data type.

  • Experiment ID = Whole number (remove the C from the beginning if possible - scatter plots don't like non-numerical values)
  • Sample ID = Whole number
  • Result = Decimal number

 

After adding Experiment ID as the x-axis set this attribute to "Don't summarize"

 

dont summarize.png

 

Do the same operation for the y-axis with Sample ID: Don't summarize

 

Add the Result column in the "Color saturation" shelf and then you can define a divering colors in the visual options to represent the Result

 

After applying these steps the data points in the scatter plot won't be summarized (Sum, count, etc.) and this should help you achieve your intended visual.

 

Sample data:

 

Experiment IDExperiment ID_NSample IDResult
C402148402148830.000
C402148402148840.006
C402148402148850.010
C402148402148860.005
C402148402148870.000
C402148402148880.000
C402148402148890.012
C402148402148900.022
C402148402148910.012
C402148402148920.022
C402148402148930.030
C402148402148940.012
C402148402148950.018
C402148402148960.016
C402148402148970.000
C402148402148980.000
C402148402148990.018
C40214940214910.014
C40214940214920.025
C40214940214930.024
C40214940214940.029
C40214940214950.030
C40214940214960.025
C40214940214970.005
C40214940214980.017
C40214940214990.023

 

Visual:

 

scatter post.png

 

Let me know if this is helpful or if you have any questions.

 

Thanks

Kevin

View solution in original post

1 REPLY 1
kevcurtis
Advocate I
Advocate I

Hi @xzhang32,

 

First, ensure when connecting/importing your data that each column has the correct data type.

  • Experiment ID = Whole number (remove the C from the beginning if possible - scatter plots don't like non-numerical values)
  • Sample ID = Whole number
  • Result = Decimal number

 

After adding Experiment ID as the x-axis set this attribute to "Don't summarize"

 

dont summarize.png

 

Do the same operation for the y-axis with Sample ID: Don't summarize

 

Add the Result column in the "Color saturation" shelf and then you can define a divering colors in the visual options to represent the Result

 

After applying these steps the data points in the scatter plot won't be summarized (Sum, count, etc.) and this should help you achieve your intended visual.

 

Sample data:

 

Experiment IDExperiment ID_NSample IDResult
C402148402148830.000
C402148402148840.006
C402148402148850.010
C402148402148860.005
C402148402148870.000
C402148402148880.000
C402148402148890.012
C402148402148900.022
C402148402148910.012
C402148402148920.022
C402148402148930.030
C402148402148940.012
C402148402148950.018
C402148402148960.016
C402148402148970.000
C402148402148980.000
C402148402148990.018
C40214940214910.014
C40214940214920.025
C40214940214930.024
C40214940214940.029
C40214940214950.030
C40214940214960.025
C40214940214970.005
C40214940214980.017
C40214940214990.023

 

Visual:

 

scatter post.png

 

Let me know if this is helpful or if you have any questions.

 

Thanks

Kevin

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.