To answer this question I need to assume that
- the material is linear
- the column is fixed at the bottom.
- the beam to the column joint is fixed.
- the load is applied at the tip of the beam
It is noted that buckling of frames is complicated by nature, the code provisions do not provide a simple formula for buckling of frames. For more advanced information, please look at the following paper which exactly solved the problem.
https://doi.org/10.1016/j.tws.2018.10.006
However, for simplicity, I assume that we are dealing with a beam-column case:

It is noted that when we are dealing with beam-columns, we need to consider the second-order deformation of the members. the differential equation of this beam-column is:
$$EI y^{\prime\prime\prime\prime} + P_0y^{\prime\prime} =0 $$
Where $E$ is Young's module, $P_0$ axial force, and $I$, the moment of inertia in minor direction. This equation can be simplified
$$y^{\prime\prime\prime\prime} + k^{2}y^{\prime\prime} =0 $$
where $k = \sqrt{\frac{P_0}{IE}}$. The solution of this Differential equation is:
$$ y = A + B + C cos(kz) + D sin(kz)$$
For finding the costant, you need to apply the boundary conditons. For fixded- free boundary conditions we have $y(0) =0$ , $y^{\prime}(L) = 0$, $y^{\prime\prime}(0) = \frac{M_0}{EI}$ and $y^{\prime\prime}(L) = \frac{M_0}{EI}$. Where $L$ is the length of the memeber.
Applying the boundary conditions gives you the constants. If you substitute the constants, the second-order deformation of the beam-column can be calculated. the moment distribution can be calculated by the formula: $M=-EI y^{\prime\prime}$
Substitute $y^{\prime\prime}$ into the above equation to find the moment distribution:
$$M = M_0 \frac{cos(kz)sin(kL)-sin(kz)cos(kL)+sin(kz)}{sin(kL)}$$
Before considering the second-order effects, the moment was constant along the laength of the column, $M_0$,. But now it is not constant. By taking the derivative $M$ with respect ot $z$, and setting it to zero, you can find the maximum point. The maximum moment can be found as
$$M_{max} = M_0 \frac{\sqrt{2}}{\sqrt{cos(kL)+1}}$$
or
$$M_{max} = M_0 \frac{\sqrt{2}}{\sqrt{cos(\pi \sqrt{\frac{P_0}{P_E}})+1}}$$
Where $P_E = \frac{\pi^2 E I}{L^2}$. This equation shows that maximum moment depends on both $P_0$ and $M_0$. You may define a moment amplification factor:
$$ M_{max} = \phi M_0 $$
where $\phi = \frac{\sqrt{2}}{\sqrt{cos(\pi \sqrt{\frac{P_0}{P_E}})+1}}$.
This amplification can be only used for your case. In different codes, you might find approximate formulas for $\phi$, which is cool.
For design, the maximum normal stress should be smaller then yielding stress, i.e.,
$$\frac{P}{A}+\frac{M_{max}}{S}=f_y$$
$A$ is the area, $S$ the elastic section module, and $f_y$ yielding stress.
In your case, the quantity of $M_0$ depends on beam loading.
Manipulation on the following equation will give the interaction relationship, but I digress. in