<!-- https://learnsql.cpetoday.com/functions/dax/roundup -->
# ROUNDUP

Language: DAX
Category: Math
Syntax: ROUNDUP(<number>, <num_digits>)
Summary: Rounds a number up, away from zero, to a set number of digits.
Returns: A number (a scalar).
Level: Beginner
Related: ROUND, ROUNDDOWN, CEILING, INT, DIVIDE, TRUNC

## What it does
ROUNDUP always rounds away from zero, so the result is never less than the input for positive numbers. It is the right choice when a partial unit still needs a full container, a full page or a full payment cycle. Use it for quantities that must be whole and must cover the need.

## Syntax and arguments
- number: the value to round up.
- num_digits: the number of decimal places to keep. 0 rounds to a whole number. A negative value rounds up to tens, hundreds or thousands.

## Example
The warehouse ships units in cases of 12. Each order needs enough full cases to cover the units, so any partial case is rounded up to a whole case.

```dax
Cases To Ship = ROUNDUP(Sales[SalesQuantity] / 12, 0)
```

An order of 25 units needs 3 cases, not 2.08. The count of cases then drives the freight cost, which is priced per case.

## Example: a second, different use
A minimum bonus pool must be paid in whole dollars, so the calculated amount is always rounded up to the next dollar:

```dax
Bonus Pool = ROUNDUP([Calculated Bonus], 0)
```

This makes the pool at least the calculated amount, which protects against a shortfall after rounding.

## Things to watch
- ROUNDUP is biased upward. A column rounded up and summed will overstate the total, so use it only when that is the rule.
- ROUNDUP rounds away from zero, so for negative numbers it moves the value further from zero. ROUNDUP(-2.1, 0) is -3. Check the sign before you rely on it.
- ROUNDUP and CEILING are close, but CEILING takes a significance value and ROUNDUP takes digits. Pick one per rule and document it.
- A zero input stays zero.
- Use ROUNDUP on the calculated quantity, not on a price, unless the contract says so.

## In business terms
ROUNDUP is used for freight by the case, pallet counts, licences or seats that must be bought in whole units, minimum payment amounts and any allocation where a short fraction must be covered. It keeps the plan honest about what is actually needed.
