There are better alternatives to \ifthenelse that don't have the problem.
Instead of \ifthenelse{\equal{#3}{}}{<empty>}{<not empty>} you can use
\ifstrempty{#3}{}{Priority & #3\\ \hline}
\ifstrempty{{#4}}{}{Members & #4\\ \hline}
This needs \usepackage{etoolbox}.
Another possibility:
\documentclass{article}
\usepackage{xparse}
\usepackage{tabularx}
% see https://tex.stackexchange.com/a/467527/4427
\ExplSyntaxOn
\NewExpandableDocumentCommand{\xifthenelse}{mmm}
{
\bool_if:nTF { #1 } { #2 } { #3 }
}
\cs_new_eq:NN \numtest \int_compare_p:n
\cs_new_eq:NN \oddtest \int_if_odd_p:n
\cs_new_eq:NN \dimtest \dim_compare_p:n
\cs_new_eq:NN \deftest \cs_if_exist_p:N
\cs_new_eq:NN \namedeftest \cs_if_exist_p:c
\cs_new_eq:NN \eqdeftest \token_if_eq_meaning_p:NN
\cs_new_eq:NN \streqtest \str_if_eq_p:ee
\cs_new_eq:NN \emptytest \tl_if_blank_p:n
\prg_new_conditional:Nnn \xxifthen_legacy_conditional:n { p,T,F,TF }
{
\use:c { if#1 } \prg_return_true: \else: \prg_return_false: \fi:
}
\cs_new_eq:NN \boolean \xxifthen_legacy_conditional_p:n
\ExplSyntaxOff
\newcommand{\ahrtable}[4]{%
\par\noindent
\begin{tabularx}{\linewidth}{|l|X|}
\hline
Title & #1\\ \hline
Caption & #2\\ \hline
\xifthenelse{\emptytest{#3}}{}{Priority & #3\\ \hline}
\xifthenelse{\emptytest{#4}}{}{Members & #4\\ \hline}
\end{tabularx}%
}
\begin{document}
\ahrtable{Title}{Caption}{}{}
\bigskip
\ahrtable{Title}{Caption}{Priority}{}
\bigskip
\ahrtable{Title}{Caption}{}{Members}
\bigskip
\ahrtable{Title}{Caption}{Priority}{Members}
\end{document}

\ithenelseadds an space to an empty block? – NelDav Apr 11 '19 at 15:30\relaxor{}for example) the tex starts processing a new cell in a new last line – David Carlisle Apr 11 '19 at 15:33