# Writing a Cube Formula

Cube formula allows business logic to be embedded within cubes and calculated in real-time. The formula can be restricted to elements or hierarchies within a cube and can calculate at the bottom level of the cube or at every level of the matching combinations of elements.