Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
WinterGarden
Helper III
Helper III

Calculating the number of data points which falls under each quadrant in a scatter plot chart

Hi All,
Is there any way we can calculate the number/count of data points which falls under each quadrant in a scatter plot chart?
I need to display the count of data points in 4 quardrants in the below visual.

WinterGarden_0-1723526747527.png

 

1 ACCEPTED SOLUTION
shafiz_p
Super User
Super User

Hi @WinterGarden , You can count data points based on x and y axis constant line condition. Quadrant 1 seperates data point based on condition, Growth% is greater than 0% and Margin is less than 0%. Similarly, other quadrants.
I have a dummy data, with customer, sales and profit. Created a scatter plot to show revenue and profit by customer. See the image below : 

shafiz_p_0-1723533278145.png


X axis constant line fixed value 5K and Y axis fixed value 0K. Quadrants splits are as follows :
Q_1 = Revenue > 5K && Profit < 0K
Q_2 = Revenue > 5K && Profit > 0K
Q_3 = Revenue < 5K && Profit > 0K
Q_4 = Revenue < 5K && Profit < 0K

Then created 4 measure : 

Q_1 =
COUNTROWS(
    FILTER(
        VALUES(Orders[CUSTOMERNAME]),
        [Revenue] > 5000 &&
        [Profit] < 0
    )
)
You need to create 4 measures in total. All others Quadrants are same, just condition will change.  If your constant line change dynamically, then replace fixed number with the dynamic variable. Use text box over the scatter plot to show the count. See the image below:

shafiz_p_1-1723533954636.png



Hope this idea helps!!

If this solved your problem, Please accept it as a solution!!!

View solution in original post

6 REPLIES 6
shafiz_p
Super User
Super User

Hi @WinterGarden , You can count data points based on x and y axis constant line condition. Quadrant 1 seperates data point based on condition, Growth% is greater than 0% and Margin is less than 0%. Similarly, other quadrants.
I have a dummy data, with customer, sales and profit. Created a scatter plot to show revenue and profit by customer. See the image below : 

shafiz_p_0-1723533278145.png


X axis constant line fixed value 5K and Y axis fixed value 0K. Quadrants splits are as follows :
Q_1 = Revenue > 5K && Profit < 0K
Q_2 = Revenue > 5K && Profit > 0K
Q_3 = Revenue < 5K && Profit > 0K
Q_4 = Revenue < 5K && Profit < 0K

Then created 4 measure : 

Q_1 =
COUNTROWS(
    FILTER(
        VALUES(Orders[CUSTOMERNAME]),
        [Revenue] > 5000 &&
        [Profit] < 0
    )
)
You need to create 4 measures in total. All others Quadrants are same, just condition will change.  If your constant line change dynamically, then replace fixed number with the dynamic variable. Use text box over the scatter plot to show the count. See the image below:

shafiz_p_1-1723533954636.png



Hope this idea helps!!

If this solved your problem, Please accept it as a solution!!!

Hi @shafiz_p ,

After filtering the area & region in the slicers.. this is how the chart looks like..

WinterGarden_0-1723540289922.png

i am using the below measure to calculate the count. But it is giving 7 instead of 4 for the -ve , +ve quadrant.Is there anthing wrong in the measure used?

GTER growth -ve , Margin +ve = COUNTROWS(FILTER(VALUES('GTER Data'[AccountName]),
([GTER_growth%]>= -1 && [GTER_growth%]< 0) && ([FY23 Account Margin %]> 0 && [FY23 Account Margin %] <= 0.75)
))

Try replace this ([GTER_growth%]>= -1 && [GTER_growth%]< 0) && ([FY23 Account Margin %]> 0 && [FY23 Account Margin %] <= 0.75) with [GTER_growth%] < 0 && [FY23 Account Margin %] > 0

Hope this works!!

@shafiz_p , Thank you so much 🙂 

Ritaf1983
Super User
Super User

Hi @WinterGarden 
Yes, it is a calculation of counting categories that match the ranges of X and Y axises.
For more detailed suggestion 

please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 ,

This is the sample data that i used in the visual.
x-axis measure: Gter Growth % = DIVIDE(([Latest_GTER] - [Latest_GTER_PY]),[Latest_GTER_PY])

[Latest_GTER] = SUM('GTER Data'[GTER YTD Constant])
[Latest_GTER_PY] = SUM('GTER Data'[GTER PFYTD Constant])
Y- axis measure: 
FY23 Account Margin % =
VAR num =SUM('GTER Data'[MarginFYTD])
VAR den = SUM('GTER Data'[NetEngagementRevenueFYTD])
RETURN
IF(ISBLANK(den),0,IF(den = 0,0,
num/den))

AccountNameHQAreaDescHQRegionDescGTER YTD ConstantGTER PFYTD ConstantNetEngagementRevenueFYTDMarginFYTD
NatAmericasFSO Americas$1,25,001.00$0.00125001-66521
NatAmericasFSO Americas$2,80,000.00$0.0026841972863
AlEMEIAEurope West$0.00$852.0000
AlEMEIAEurope West$0.00$268.0000
NatAmericasFSO Americas$0.00$34,912.0000
NatAmericasFSO Americas$0.00$3.0000
NatAmericasFSO Americas$0.00$516.0000
AlEMEIAEurope West$0.00$2,67,425.0000
NatAmericasFSO Americas$0.00$5,41,778.0000
NatAmericasFSO Americas$30,381.00$13,86,777.0030381-18066
AlEMEIAEurope West$1,51,571.00$3,03,688.0014649091930
AlEMEIAEurope West$1,08,558.00$33,49,269.00108426108426
AlEMEIAEurope West($870.00)$2,39,763.00-815-285
AlEMEIAEurope West$8,576.00$2,75,687.0087262353
AlEMEIAEurope West($1,132.00)$10,92,346.00-1814-8318
AlEMEIAEMEIA Elim Region($1,51,571.00)($3,03,688.00)-146490-91930
AlEMEIAEGP$1,51,571.00$3,03,688.0014649091930
AlEMEIAEMEIA Elim Region$1,132.00($10,92,346.00)18148318
AlEMEIAEGP($1,132.00)$10,92,346.00-1814-8318
AlEMEIAEMEIA Elim Region$870.00($2,39,763.00)815285
AlEMEIAEGP($870.00)$2,39,763.00-815-285
NatAmericasFSO Americas$3,37,612.00$89,416.00334120193774
NatAmericasFSO Americas$0.00$20,983.0000
NatAmericasFSO Americas$11,61,352.00$11,73,373.001158766362570
NatAmericasFSO Americas$31,477.00($4,940.00)225006426
NatAmericasFSO Americas$89,43,846.00$1,43,20,623.0089344303528241
NatAmericasFSO Americas$20,99,678.00$3,02,591.0020959401084129

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors