Find Matrix $P$ so $B=PA$ I have this problem. 

$$A =  \left(\begin{array}{ccc}
1 &amp; 2 &amp; 3 \\
2 &amp; 4 &amp; 6 \\
1 &amp; 2 &amp; 3 \end{array}\right)$$

$$B =  \left(\begin{array}{ccc}
1 &amp; 2 &amp; 3 \\
0 &amp; 0 &amp; 0 \\
0 &amp; 0 &amp; 0 \end{array}\right)$$

Find matrix $P$ invertible so $B=PA$.

It's pretty clear in this case.

But I wonder is there a way to find such a matrix in general case, when it's not obvious.

Any help will be appreciated.
By row reducing, you can find matrices $P_1,P_2$ such that $P_1A$ and $P_2B$ are in the same row-echelon form.  From there, we can say that
$$
P_1A = P_2B \implies B = (P_2^{-1}P_1)A
$$
This will work whenever such a $P$ exists.



For your example: note that $B$ is in row-echelon form.  So, in this case, we have $P_2 = I$.  For $A$, we have
$$
\pmatrix{
1&amp;2&amp;3&amp;&amp;1&amp;0&amp;0\\
2&amp;4&amp;6&amp;&amp;0&amp;1&amp;0\\
1&amp;2&amp;3&amp;&amp;0&amp;0&amp;1} 
\mathop{\leadsto}^{R_3\to R_3-R_1}\cdots
\mathop{\leadsto}^{R_2\to R_2-2R_1}\\
\pmatrix{
1&amp;2&amp;3&amp;&amp;1&amp;0&amp;0\\
0&amp;0&amp;0&amp;&amp;-2&amp;1&amp;0\\
0&amp;0&amp;0&amp;&amp;-1&amp;0&amp;1} 
$$
So, 
$$
P_1 = \pmatrix{
1&amp;0&amp;0\\
-2&amp;1&amp;0\\
-1&amp;0&amp;1
}
$$
when you row reducing a matrix $A$ by hand, it is much easier to keep track of the row operations, if we augment the matrix $A$ with a column like this:
$ \left( \begin{array}{lll|l} 1 &amp; 2 &amp; 3 &amp; a\cr 2 &amp; 4 &amp; 6 &amp; b\cr 1 &amp; 2 &amp; 3 &amp; c\end{array} \right) \to 
\left( \begin{array}{lll|l} 1 &amp; 2 &amp; 3 &amp; a\cr 0 &amp; 0 &amp; 0 &amp; -2a + b\cr 
0 &amp; 0 &amp; 0 &amp; -a+c\end{array} \right) 
$
you decode this as multiplying by the matrix $E$ on the left where 
$ E \pmatrix{a \cr b\cr c}=\pmatrix{1 &amp; 0 &amp; 0\cr-2 &amp; 1 &amp; 0\cr -1 &amp; 0 &amp; 1}\pmatrix{a\cr b\cr c\cr d} =  \pmatrix{a &amp;\cr-2a+b\cr -a+c}.$ 

that is $EA = U.$ of course, if you are calculator or computer matrix software, you augment by the identity matrix as suggested by others.