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
AC_DATA
Frequent Visitor

Scatter Plot Average Line

I am trying to get an accurate average line on a scatter plot with average values plotted for items by their count.

PBI takes an average of the averages which yields an inaccurate number. How can I get the average line to show the overall average of all the items in the plot, not the average of the averages of the items by category in the plot (see the picture below)?

 

Scatter Plot Example.png

 

Here is the sample data (there is a report-level filter on TYPE = "Fruit"):

UIDTYPECATEGORYITEM_VALUE
1FruitApple2.2
2FruitApple1.3
3FruitApple2.9
4FruitBanana2.0
5FruitBanana1.1
6FruitCherry4.3
7FruitCherry1.7
8FruitCherry5.5
9FruitCherry2.0
10FruitDragonfruit3.5
11FruitDragonfruit1.2
12FruitDragonfruit2.0
13FruitElderberry1.7
14FruitElderberry3.1
15VegetablePotato2.5
16VegetablePotato1.4
17VegetablePotato2.6
18VegetablePotato1.1
19VegetableBroccoli2.6
20VegetableBroccoli3.7
21VegetableBroccoli2.7
22VegetableSquash5.1
23VegetableSquash5.4
24VegetableSquash4.7
25VegetableCorn4.4
26VegetableCorn3.9
27VegetableCorn4.9
28VegetableCorn1.8
29VegetableCorn1.9
30VegetableLettuce1.8
31VegetableLettuce2.5

 

Here is the DAX for the calculated column:

 
Average Item Value By Category (Column) = CALCULATE(
    AVERAGE(DATA_SET[ITEM_VALUE]),
    ALLEXCEPT(DATA_SET, DATA_SET[TYPE])
)
 
1 ACCEPTED SOLUTION
Cmcmahan
Resident Rockstar
Resident Rockstar

Looking at your chart, it seems odd that your X-axis is a count of UIDs.   It seems that how many UID's a certain product category has isn't a useful way to group or plot them.  However, it seems your problem resides in how simple and uncustomizable the Data Analytics lines are for scatterplots.

 

I've done some reasearch, and playing around with your example file, and as far as I can tell, there's no way accomplish this with a scatterplot, unless you make a custom visual. I even played around with some of the scatterplots on the marketplace, and none of them seemed to be able to accomplish this either.

 

My solution would be to use a different visual.  I'd set this up as a bar and line chart.  Then you can set up a measure or your average column as the line value, and set the category types as the X-Axis.

 

View solution in original post

3 REPLIES 3
sfosfo
New Member

 

up

 

still no solution around?

 

i face the same problem not having the option to have a weight calculation when average on group of record

 

this will be major PITA for my project with Powerbi if no workaround.

i need to do a lot bubble chart at group level with a weighted average (which allow to show which group perform better than the average)

 

Cmcmahan
Resident Rockstar
Resident Rockstar

Looking at your chart, it seems odd that your X-axis is a count of UIDs.   It seems that how many UID's a certain product category has isn't a useful way to group or plot them.  However, it seems your problem resides in how simple and uncustomizable the Data Analytics lines are for scatterplots.

 

I've done some reasearch, and playing around with your example file, and as far as I can tell, there's no way accomplish this with a scatterplot, unless you make a custom visual. I even played around with some of the scatterplots on the marketplace, and none of them seemed to be able to accomplish this either.

 

My solution would be to use a different visual.  I'd set this up as a bar and line chart.  Then you can set up a measure or your average column as the line value, and set the category types as the X-Axis.

 

Thank you, @Cmcmahan. That is what I was afraid of.

I will try a different visualization type before venturing into the realms of creating custom visualizations.

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.

Top Solution Authors