Using the definition of conditional expectation given an event I need to show
$$ E (I_B | A) = P(B|A).$$
So far I have
\begin{align*} E (I_B | A) &= \sum_x 1\cdot P(I_B = 1 |A) P(A) + 0 \cdot P(I_B = 0|A)P(A) \\ &= \sum_x P(I_B = 1 | A) P(A) \\ &= \sum_x P(B | A) P(A) \\ &= P(B|A). \end{align*}
I feel like there is something I am missing here. I was hoping somebody could better explain to me how to work on conditioning with two events. My book doesn't go into much detail on the matter, only addresses the case with one event.