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 MONTH Function
The syntax of the MONTH function is as follows:
MONTH(❰date❱)
Here, `❰date❱` is the column or expression that represents a date value. The MONTH function extracts the month from the date value and returns an integer value between 1 and 12.
Examples of Using the MONTH Function
Let's take a look at some examples of using the MONTH function in Power BI.
Example 1: Extracting Month from a Date Column
Suppose we have a dataset that contains a column named "Date" that stores date values. We want to extract the month from this column and create a new column named "Month" that contains the month number. To do this, we can use the following DAX expression:
Month = MONTH([Date])
This expression creates a new column named "Month" that contains the month number extracted from the "Date" column. We can now use this column to analyze and visualize data in a report.
Example 2: Using the MONTH Function in a Measure
Suppose we have a dataset that contains a column named "Sales" that stores sales data, and a column named "Date" that stores date values. We want to create a measure that calculates the total sales for each month. To do this, we can use the following DAX expression:
Total Sales = SUM([Sales])
Sales by Month = CALCULATE([Total Sales], MONTH([Date]))
This expression creates a measure named "Sales by Month" that calculates the total sales for each month. The MONTH function is used as a filter to calculate the sales for each month.
The MONTH function in Power BI is a powerful tool that allows you to extract the month from a date value and use it in analysis and visualization. By using this function, you can perform various analyses, such as calculating total sales by month, analyzing trends, and more. We hope this article has helped you understand how to use the MONTH function in Power BI.