March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
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:
Create a Scatter Plot Visual: In Power BI Desktop, add a scatter plot visual to your report.
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.
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.
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:
Create a Scatter Plot Visual: Add a scatter plot visual to your report as mentioned earlier.
Drag the Data Fields: Drag your categorical data fields to the appropriate areas in the visual.
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
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.
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.
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.
The following might help you
Transparency = VAR MaxDensity = MAX('YourTableName'[DensityMeasure]) RETURN IF(ISBLANK([DensityMeasure]), 0, [DensityMeasure] / MaxDensity)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |