k-nearest neighbors (Euclidean distance): How to process multiple attributes?
Straight from definition:

$\sqrt{(q_1-p_1)^2 + (q_2-p_2)^2 + \cdots + (q_n-p_n)^2}$

In your particular case $n = 3$, so the query should also be 3D (e.g. {7, 4, 3}.

$\sqrt{(q_1-p_1)^2 + (q_2-p_2)^2 + (q_3-p_3)^2}$

So plugging in the third dimension:
$$\begin{array}{|c|c|c|l|} \hline
X1 &amp; X2 (Kg/m^2) &amp; X3 &amp; \text{Square distance to query point  {7, 4, 3}} \\ \hline
8 &amp; 4 &amp; 2 &amp; (8 - 7)^2 + (4 - 4)^2 + (2 - 3)^2= 2 \\ \hline
4 &amp; 5 &amp; 5 &amp; (4 - 7)^2 + (5 - 4)^2 + (5 - 3)^2= 14 \\ \hline
4 &amp; 6 &amp; 1 &amp; (4 - 7)^2 + (6 - 4)^2 + (1 - 3)^2= 17 \\ \hline
7 &amp; 7 &amp; 4 &amp; (7 - 7)^2 + (7 - 4)^2 + (4 - 3)^2= 10 \\ \hline
5 &amp; 6 &amp; 6 &amp; (5 - 7)^2 + (6 - 4)^2 + (6 - 3)^2= 17 \\ \hline
6 &amp; 5 &amp; 2 &amp; (6 - 7)^2 + (5 - 4)^2 + (2 - 3)^2= 3 \\ \hline
\end{array}$$