A capacitor unit comprising: a housing that accommodates a capacitor main body therein; a harness side terminal provided on a first end portion side of a first surface of the housing and connectable to a power source harness for supplying DC power from an outside; a board side terminal provided in the housing and connectable to a circuit board from which the DC power is output via the capacitor main body; and a plurality of guide portions that protrude from the first surface and extend from a second end portion on a side opposite to the first end portion on the first surface toward the first end portion; characterized by a harness abutting portion (27,28) that protrudes on the second end portion side of the first surface and that is configured to abut against the power source harness, wherein the plurality of guide portions are provided to be separated in a width direction orthogonal to a forward-rearward direction of connecting the first end portion and the second end portion to each other so as to sandwich the harness side terminal therebetween, and wherein the harness abutting portion includes a first harness abutting portion which is provided at a position closer to the second end portion than a center of the first surface in the forward-rearward direction and protrudes in an upward-downward direction orthogonal to the upper surface in a center portion in the width direction in the second end portion of the upper surface to abut against the power source harness in the width direction, and a second harness abutting portion which protrudes from the second end portion side adjacent to a side of the first harness abutting portion in the second end portion so as to be able to abut against the power source harness from a lower side in the upward-downward direction orthogonal to the upper surface, wherein the second harness abutting portion is provided to be adjacent to both sides of the first harness abutting portion in the width direction in the second end portion and has a smaller protrusion dimension from the first surface of the housing than the first harness abutting portion. a housing that accommodates a capacitor main body therein; a harness side terminal provided on a first end portion side of a first surface of the housing and connectable to a power source harness for supplying DC power from an outside; a board side terminal provided in the housing and connectable to a circuit board from which the DC power is output via the capacitor main body; and a plurality of guide portions that protrude from the first surface and extend from a second end portion on a side opposite to the first end portion on the first surface toward the first end portion; characterized by a harness abutting portion (27,28) that protrudes on the second end portion side of the first surface and that is configured to abut against the power source harness, wherein the plurality of guide portions are provided to be separated in a width direction orthogonal to a forward-rearward direction of connecting the first end portion and the second end portion to each other so as to sandwich the harness side terminal therebetween, and wherein the harness abutting portion includes a first harness abutting portion which is provided at a position closer to the second end portion than a center of the first surface in the forward-rearward direction and protrudes in an upward-downward direction orthogonal to the upper surface in a center portion in the width direction in the second end portion of the upper surface to abut against the power source harness in the width direction, and a second harness abutting portion which protrudes from the second end portion side adjacent to a side of the first harness abutting portion in the second end portion so as to be able to abut against the power source harness from a lower side in the upward-downward direction orthogonal to the upper surface, wherein the second harness abutting portion is provided to be adjacent to both sides of the first harness abutting portion in the width direction in the second end portion and has a smaller protrusion dimension from the first surface of the housing than the first harness abutting portion. a second harness abutting portion which protrudes from the second end portion side adjacent to a side of the first harness abutting portion in the second end portion so as to be able to abut against the power source harness from a lower side in the upward-downward direction orthogonal to the upper surface, wherein the second harness abutting portion is provided to be adjacent to both sides of the first harness abutting portion in the width direction in the second end portion and has a smaller protrusion dimension from the first surface of the housing than the first harness abutting portion.