A terahertz bifunctional absorber is presented with broadband and narrowband absorbing properties in a graphene-spacer-vanadium dioxide-spacer-metal configuration. Carrier relaxation time of graphene τ = 1.0ps (τ = 0.1ps) is chosen for narrowband (broadband) absorption. When vanadium dioxide is in the conducting state, the design behaves as a narrowband absorber, and it is composed of a square-shaped graphene, topas spacer, and metallic vanadium dioxide film. There is an absorption band with 100% absorptance at the frequency of 1.37 THz. Narrowband absorption is caused by the localized magnetic resonance. When vanadium dioxide is in the insulating state, the design behaves as a broadband absorber composed of a square-shaped graphene, topas layer, vanadium dioxide film, and metal film. It has a broadband absorption in the frequency range of 1.05-2.35 THz, and the corresponding absorptance is more than 90%. The merging of two resonances with overlapping region ensures broadband performance of the designed absorber. The working bandwidth and intensity of narrowband absorption and broadband absorption can be dynamically adjusted by changing the Fermi energy level of graphene. The influences of structure parameters are discussed on absorption performance. In addition, the designed absorber is not sensitive to incident angle. Because of the simple structure, our design can be applied to many promising fields in intelligent absorption and terahertz switch.