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
Anonymous
Not applicable

Scater plot for a lot of points as categorical data

Hey

I have a categorical data set such 99 categories. When I plot the dcatrry'lot my data, I see only a few data because most of them have the same x and y. How I can handle that to see how many data exists at each point?

thanks a lot 

3 REPLIES 3
123abc
Community Champion
Community Champion

In Power BI, when you have categorical data with many categories and you want to visualize how many data points exist at each point (i.e., how many data points share the same x and y values), you can use a scatter plot with transparency or jittering to make the overlapping data points visible. Here's how you can do it:

Using Transparency:

  1. Create a Scatter Plot Visual: In Power BI Desktop, add a scatter plot visual to your report.

  2. Drag the Data Fields: In the scatter plot visual, drag the categorical data fields to the "Axis" or "Legend" area, depending on how you want to categorize the data points.

  3. Add Transparency to the Marks: To make overlapping data points more visible, you can add transparency to the data marks. To do this:

    a. Select the data points in your scatter plot visual by clicking on them (or select all points if needed).

    b. In the "Format" pane, under the "Data colors" section, find the "Transparency" slider. Increase the transparency to a level where overlapping points become distinguishable.

  4. Customize the Visual: You can further customize the visual by adjusting the colors, markers, labels, and other visual settings to make it more informative and appealing.

Using Jittering:

Another way to handle overlapping data points is by adding a bit of random jitter to their positions. This will spread out the points slightly so that you can see the density more clearly. Here's how to do it:

  1. Create a Scatter Plot Visual: Add a scatter plot visual to your report as mentioned earlier.

  2. Drag the Data Fields: Drag your categorical data fields to the appropriate areas in the visual.

  3. Enable Jittering: To enable jittering in Power BI, you can use DAX measures to add random noise to the x and y coordinates of your data points. For example:

JitteredX = YourTable[X] + RAND() / 10,

JitteredY = YourTable[Y] + RAND() / 10

 

  1. In this example, we add a small random value to the x and y coordinates using the RAND() function. Adjust the value (/ 10 in this case) to control the amount of jittering.

  2. Use Jittered Fields in the Scatter Plot: Replace the original X and Y fields in your scatter plot visual with the jittered X and Y fields you created in the previous step.

  3. Customize the Visual: Customize the visual as needed, including transparency settings if desired.

Using transparency or jittering allows you to visualize the density of data points in a scatter plot with many categories more effectively, making it easier to see how many data points exist at each point. Adjust the level of transparency or jittering to achieve the desired visual representation.

 
 
 

Hi there,

 

The RAND() function does not work when creating a new Column:

Function 'RAND' is not allowed as part of calculated column DAX expressions on DirectQuery models.

 

And creating a new measure does work but I cannot use it to create Jitter in x or y direction. How exactly can you implement this? I don't see how to create the jitter and it would really help! Thanks.

nirali_arora
Resolver II
Resolver II

The following might help you 

Transparency = VAR MaxDensity = MAX('YourTableName'[DensityMeasure]) RETURN IF(ISBLANK([DensityMeasure]), 0, [DensityMeasure] / MaxDensity)

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.