Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Duplicated values added together in scatterplot

Hi all,

 

I was wondering if anybody is able to help with a scatter plot issue (more specifically a Craydec regression chart).

I'm plotting percentages for two separate metrics on my x and y axis. Each data point corresponds to a location. It looks something like this:

It should be that each datapoint corresponds to a single location so that when you click on it, you get the percentages for the x and y metrics for a single location. 

This mostly works fine, but there's a problem when there's more than one location with the same value for either the x or y axis. When one of the metrics has the same value for multiple locations, the scatter plot doesn't plot each data point individually, but instead adds the values together and plots the additive value as a single data point.

 

As an example, here's two locations that have the same value. These values belong on the x-axis:

And here's the y-axis values for those same locations:

There should be two separate data points on the scatter plot, one for each of these locations, which I've drawn on at the roughly correct co-ordinate in the image below. But instead it adds them together and plots them as one, which you can see as the selected data point squared in red. 

 

Does anyone know why this happens? I'd understand it if both x and y values were the same, as then I guess it would be that the datapoints for each location were just overlaying one another. But I don't know why it happens when just one of the axes has the same value. This is using a Craydec regression chart, but the same problem arises in PowerBI's standard scatter plot visualisation. Any ideas for how to solve would be very much appreciated! 

 

Thanks 🙂

 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    I realise that this is an uncommon problem, but in the event that anybody else experiences this problem, I figured out the solution, which is below:

     

    First, every single row of data needs to have a unique ID. You can do this by creating an index column in the query editor by doing the following:

     

    This Index column then needs to be entered into the 'Unique ID' field in the Craydec Regression Chart visual:

     

    That then means that every single row of data you have is plotted as an individual data point -- no funny behaviour with duplicate values.

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    I realise that this is an uncommon problem, but in the event that anybody else experiences this problem, I figured out the solution, which is below:

     

    First, every single row of data needs to have a unique ID. You can do this by creating an index column in the query editor by doing the following:

     

    This Index column then needs to be entered into the 'Unique ID' field in the Craydec Regression Chart visual:

     

    That then means that every single row of data you have is plotted as an individual data point -- no funny behaviour with duplicate values.