The dirty price is calculated when a bond is bought or sold between coupon payment dates. It ensures that both parties account for the interest that has accumulated but has not yet been paid.