cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

Accepted Solutions
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
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

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors