The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Solved! Go to Solution.
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 :
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 :
Hope this idea helps!!
If this solved your problem, Please accept it as a solution!!!
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 :
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 :
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..
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?
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!!
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
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))
AccountName | HQAreaDesc | HQRegionDesc | GTER YTD Constant | GTER PFYTD Constant | NetEngagementRevenueFYTD | MarginFYTD |
Nat | Americas | FSO Americas | $1,25,001.00 | $0.00 | 125001 | -66521 |
Nat | Americas | FSO Americas | $2,80,000.00 | $0.00 | 268419 | 72863 |
Al | EMEIA | Europe West | $0.00 | $852.00 | 0 | 0 |
Al | EMEIA | Europe West | $0.00 | $268.00 | 0 | 0 |
Nat | Americas | FSO Americas | $0.00 | $34,912.00 | 0 | 0 |
Nat | Americas | FSO Americas | $0.00 | $3.00 | 0 | 0 |
Nat | Americas | FSO Americas | $0.00 | $516.00 | 0 | 0 |
Al | EMEIA | Europe West | $0.00 | $2,67,425.00 | 0 | 0 |
Nat | Americas | FSO Americas | $0.00 | $5,41,778.00 | 0 | 0 |
Nat | Americas | FSO Americas | $30,381.00 | $13,86,777.00 | 30381 | -18066 |
Al | EMEIA | Europe West | $1,51,571.00 | $3,03,688.00 | 146490 | 91930 |
Al | EMEIA | Europe West | $1,08,558.00 | $33,49,269.00 | 108426 | 108426 |
Al | EMEIA | Europe West | ($870.00) | $2,39,763.00 | -815 | -285 |
Al | EMEIA | Europe West | $8,576.00 | $2,75,687.00 | 8726 | 2353 |
Al | EMEIA | Europe West | ($1,132.00) | $10,92,346.00 | -1814 | -8318 |
Al | EMEIA | EMEIA Elim Region | ($1,51,571.00) | ($3,03,688.00) | -146490 | -91930 |
Al | EMEIA | EGP | $1,51,571.00 | $3,03,688.00 | 146490 | 91930 |
Al | EMEIA | EMEIA Elim Region | $1,132.00 | ($10,92,346.00) | 1814 | 8318 |
Al | EMEIA | EGP | ($1,132.00) | $10,92,346.00 | -1814 | -8318 |
Al | EMEIA | EMEIA Elim Region | $870.00 | ($2,39,763.00) | 815 | 285 |
Al | EMEIA | EGP | ($870.00) | $2,39,763.00 | -815 | -285 |
Nat | Americas | FSO Americas | $3,37,612.00 | $89,416.00 | 334120 | 193774 |
Nat | Americas | FSO Americas | $0.00 | $20,983.00 | 0 | 0 |
Nat | Americas | FSO Americas | $11,61,352.00 | $11,73,373.00 | 1158766 | 362570 |
Nat | Americas | FSO Americas | $31,477.00 | ($4,940.00) | 22500 | 6426 |
Nat | Americas | FSO Americas | $89,43,846.00 | $1,43,20,623.00 | 8934430 | 3528241 |
Nat | Americas | FSO Americas | $20,99,678.00 | $3,02,591.00 | 2095940 | 1084129 |