I removed some ceiling beams and as part of the process needed to remove some trim. I cut a board to size and put it up to test the fit. Fit is great except there is a gap as something is not quite level I'm guessing the ceiling.

I attached a pic. How can I make the board flush through the entire span. It is 13' stretch.

I'm not concerned with where the trim meets the ceiling as I wil put some crown molding there but I want the trim to be flush with the board that it meets at a 90 degree angle. You can see in the picture that in the middle there is a gap.

To be on the safe side,this to me looks like there is a sag in the ceiling. Is this a bearing wall that someone did not make the beam large enough? I do not know, but if I where you I would look into it.

As for the trim if it's good to go, just install the crown , You will never notice it when it is finished, actually happens alot in older homes, just split the difference best you can and call it done.

The beams I took down were decorative and the one in question is load bearing. Having just bought the house I can't say about the beam being sized ok. Hopefully it is just a case of an old house. The house is 47 its old.

Sure looks like someone removed part of a supporting wall to me.
I'd bet the floors up stairs are sagging and bouncy also. There is a way to fix this right so it will no longer sag, the floors up stairs will be flatter, doors up stairs will not be croooked.

A good contractor will be fine. You can have them engineer what they need at a local lumber yard.
An engineer will give you what you need also, either way your going to end up paying something.
This actually happens alot....when folks do not pull permits, and DIY. You just happen to be on the receiving end, but it is an easy fix with a new beam and temporary walls, or even a steel plate bolted to the sides. Depends on the structure.
Good luck.

I appreciate the advice. would rather get it squared away. And you are absolutely right about the floors upstairs. I was wondering why they sagged in a certain area and now I see it corresponds with where that beam is below.