Contributor

# MROUND in Power Query

Is there an easy alternative for MROUND() in Power Query?

I know the Number.Round functions, but I find no direct alternative for MROUND()?

5 Replies

# RE: MROUND in Power Query

Thanks for the link. Great solution, but a bit overly complicated for my use-case, I think (multiples of integers, instead of rounding behind the comma).

I've been experimenting a bit more, and came up with this (for rounding up to multiples of 50)

=Number.RoundUp([Decimal]/50)*50

# RE: MROUND in Power Query

I guess it shall be just round, not up

``=Number.Round([Decimal]/50)*50``

# RE: MROUND in Power Query

Also possible, depending on the use case of course. (In my case I needed rounding up.)

# RE: MROUND in Power Query

Oh, I see. When as variant

``[Decimal] - Number.Mod([Decimal], 50) +50``