A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
Syntax of the MROUND function
The MROUND function in DAX has the following syntax:
MROUND(❰number❱, ❰multiple❱)
- `❰number❱`: This is the number that you want to round to the nearest specified multiple.
- `❰multiple❱`: This is the value that you want to round to. The `❰number❱` argument is rounded to the nearest multiple of this value.
Examples of Using the MROUND Function in Power BI
Example 1: Rounding to the nearest dollar
Suppose you have a dataset that contains sales data for a particular store and you want to round the sales figures to the nearest dollar. You can achieve this by using the MROUND function as follows:
= MROUND(Sales[Amount], 1)
This formula will round the `Amount` column in the `Sales` table to the nearest dollar.
Example 2: Rounding to the nearest thousand
Suppose you have a dataset that contains data on employee salaries and you want to round the salaries to the nearest thousand dollars. You can achieve this by using the MROUND function as follows:
= MROUND(Employee[Salary], 1000)
This formula will round the `Salary` column in the `Employee` table to the nearest thousand dollars.
Example 3: Rounding to the nearest 0.5
Suppose you have a dataset that contains data on stock prices and you want to round the stock prices to the nearest 0.5. You can achieve this by using the MROUND function as follows:
= MROUND(Stock[Price], 0.5)
This formula will round the `Price` column in the `Stock` table to the nearest 0.5.
The MROUND function in DAX is a powerful tool that can be used to round a given number to the nearest specified multiple. It can be especially useful when dealing with financial data or when performing calculations that require a specific level of accuracy. In this article, we have explored how to use the MROUND function in Power BI and provided some examples to demonstrate its capabilities. With this knowledge, you can now use the MROUND function to round numbers in your own Power BI projects.