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 MOD Function
Before diving into how to use the MOD function in Power BI DAX, it is important to understand the syntax of the function. The MOD function takes two arguments:
MOD(❰numerator❱, ❰denominator❱)
Here, the numerator is the number that you want to divide, and the denominator is the number you want to divide by.
How to Use the MOD Function in Power BI DAX
To better understand how to use the MOD function in Power BI DAX, let's take a look at an example. Suppose we have a table containing a list of numbers, and we want to create a new column that returns the remainder when each number is divided by 3. Here's how we can do it:
1. First, we need to open a new query in Power BI Desktop and connect to the data source containing the table.
2. Next, we need to create a new column in the table by clicking on "New Column" under the "Modeling" tab in the ribbon.
3. In the formula bar, we need to enter the following formula:
MOD(❰ColumnName❱, 3)
Here, `❰ColumnName❱` is the name of the column containing the list of numbers. This formula will return the remainder when each number in the column is divided by 3.
4. Finally, we need to give a name to the new column by typing it in the "Column name" field at the top of the formula bar.
5. Once we click on "OK", the new column will be added to the table, and we can use it in our analysis.
Additional Tips for Using the MOD Function
Here are some additional tips for using the MOD function in Power BI DAX:
- The MOD function can also be used with negative numbers. In this case, the result will also be negative.
- If the denominator is 0, the MOD function will return a #NUM! error.
- The MOD function can be combined with other functions in Power BI DAX to create more complex calculations.
The MOD function in Power BI DAX is a very useful tool for data analysis and calculations. By following the steps outlined in this article, you can easily use the MOD function to return the remainder after dividing one number by another. Remember to follow the syntax of the function and avoid dividing by zero to get accurate results.