An assembly of a door or a window of a building, comprising - a swivel element (1, 1'), - a frame (2, 2') on which the swivel element (1, 1') is pivotally arranged about a swivel axis, and - a motorized drive device which for pivoting the swivel element (1, 1') relative to the frame (2, 2') acts between the swivel element (1, 1') and the frame (2, 2') and is formed by a spindle drive comprising a spindle extending along a longitudinal axis and a spindle nut in threaded engagement with the spindle, wherein the spindle drive is fixedly arranged on the swivel element (1, 1') along the longitudinal axis, wherein the spindle drive includes a push rod extending along the longitudinal axis, which, driven by a movement of the spindle relative to the spindle nut, is shiftable on the swivel element (1, 1') along the longitudinal axis and is coupled to the frame (2, 2') via a joint rod articulated to the push rod in order to pivot the swivel element (2, 2') relative to the frame (1, 1') by shifting the push rod, wherein the spindle is rotatably arranged on a housing and is operatively connected to an electric motor for driving the spindle, wherein the spindle nut is non-rotatably arranged on a tube of the push rod shiftably mounted on the housing in such a way that during a rotary movement of the spindle the spindle nut is shifted together with the tube relative to the housing along the longitudinal axis, wherein the swivel element (1, 1') has a body and the spindle drive extends within the body, wherein the push rod acts between the swivel element (1, 1') and the frame (2, 2') via a secondary closing edge of the swivel element (1, 1'), via which the swivel element (1, 1') is pivotally arranged on the frame (2, 2') and which is directed parallel to the swivel axis, wherein the joint rod exits from the swivel element (1, 1') on the secondary closing edge and the push rod is hingedly supported on a counter closing edge of the frame (2, 2') opposite the secondary closing edge via the joint rod, wherein the joint rod is hingedly connected to the push rod via a coupling point and hingedly connected to the counter closing edge of the frame (2, 2') via a bearing, wherein the spindle drive is fixedly arranged on the swivel element (1, 1') via a fixed bearing and a further bearing spaced apart from the fixed bearing along the longitudinal axis. - a swivel element (1, 1'), - a frame (2, 2') on which the swivel element (1, 1') is pivotally arranged about a swivel axis, and - a motorized drive device which for pivoting the swivel element (1, 1') relative to the frame (2, 2') acts between the swivel element (1, 1') and the frame (2, 2') and is formed by a spindle drive comprising a spindle extending along a longitudinal axis and a spindle nut in threaded engagement with the spindle, wherein the spindle drive is fixedly arranged on the swivel element (1, 1') along the longitudinal axis, wherein the spindle drive includes a push rod extending along the longitudinal axis, which, driven by a movement of the spindle relative to the spindle nut, is shiftable on the swivel element (1, 1') along the longitudinal axis and is coupled to the frame (2, 2') via a joint rod articulated to the push rod in order to pivot the swivel element (2, 2') relative to the frame (1, 1') by shifting the push rod, wherein the spindle is rotatably arranged on a housing and is operatively connected to an electric motor for driving the spindle, wherein the spindle nut is non-rotatably arranged on a tube of the push rod shiftably mounted on the housing in such a way that during a rotary movement of the spindle the spindle nut is shifted together with the tube relative to the housing along the longitudinal axis, wherein the swivel element (1, 1') has a body and the spindle drive extends within the body, wherein the push rod acts between the swivel element (1, 1') and the frame (2, 2') via a secondary closing edge of the swivel element (1, 1'), via which the swivel element (1, 1') is pivotally arranged on the frame (2, 2') and which is directed parallel to the swivel axis, wherein the joint rod exits from the swivel element (1, 1') on the secondary closing edge and the push rod is hingedly supported on a counter closing edge of the frame (2, 2') opposite the secondary closing edge via the joint rod, wherein the joint rod is hingedly connected to the push rod via a coupling point and hingedly connected to the counter closing edge of the frame (2, 2') via a bearing, wherein the spindle drive is fixedly arranged on the swivel element (1, 1') via a fixed bearing and a further bearing spaced apart from the fixed bearing along the longitudinal axis.