Power Apps Month() Function [With Examples]

While developing a Power Apps app, managing dates can be a puzzle. No worries! I am here to help you understand the Power Apps Month() Function that extracts the month from a date value.

Let’s explore how this function can tackle data-related issues and make your apps more interactive and dynamic.

In this Power Apps tutorial, Let’s take a closer look at this Power Apps Month function with its syntax and different examples like:

  1. Get Month from Selected date in PowerApps
  2. Power Apps calculate the number of days in a month
  3. Get Current and Previous N Month Name in Power Apps
  4. How to get the first day of the month in Power Apps
  5. Power Apps add months from start date to get the end date

Power Apps Month() Function

Power Apps Month function allows you to easily work with dates and extract the month from a specific date.

This function typically falls within the range of 1 to 12, representing the number of the month like Jan=1, Feb=2, Mar=3, etc. The syntax of the Month function is mentioned below:

Month( DateTime )

Now, let us check how to utilize this function in different scenarios:

Get Month from Selected date in PowerApps

Let’s check how to display the month number from a selected date in Power Apps.

Example:

The Power Apps screen has a Date-picker control and a Text label control. When the user selects a date from the date-picker as “03/28/2025,” the text label will display only the month number as 3 [from the user-provided date], as shown below:

Get Month from selected date in Power Apps

Follow the below steps to achieve this:

  • Select the Text label and set its Text property as:
Month(dte_ProjectStartDate.SelectedDate)

Where,

  1. dte_ProjectStartDate = Date-picker control name
Power Apps Get Month from selected date
  • Once the app is ready, SavePublish, and Preview it. The text label will display the month from the date selected in the date picker.
How to get month from selected date in Power Apps

This is how we can get the month from the selected date in Power Apps.

Power Apps calculate the number of days in a month

Here, let us check how to calculate the number of days in a month in Power Apps.

Example:

The Power Apps screen has a Date-picker control and Text label. Whenever the user selects a date from the date-picker, the text label displays the remaining days of the month except for Sundays.

Power Apps calculate number of days in month

Let me show you how to achieve it:

  • Select the Text label -> Set its Text property to:
With(
    {
        StartDate: Date(
            Year(dte_CalMonthDays.SelectedDate),
            Month(dte_CalMonthDays.SelectedDate),
            1
        ),
        LastDate: DateAdd(
            DateAdd(
                Date(
                    Year(dte_CalMonthDays.SelectedDate),
                    Month(dte_CalMonthDays.SelectedDate),
                    1
                ),
                1,
                TimeUnit.Months
            ),
            -1,
            TimeUnit.Days
        )
    },
    If(
        StartDate = LastDate,
        Sum(
            If(
                Weekday(StartDate) = 1,
                0,
                1
            )
        ),
        Sum(
            ForAll(
                Sequence(
                    DateDiff(
                        StartDate,
                        LastDate,
                        TimeUnit.Days
                    ),
                    0,
                    1
                ),
                If(
                    Weekday(
                        DateAdd(
                            StartDate,
                            Value
                        )
                    ) = 1,
                    {DayCount: 0},
                    {DayCount: 1}
                )
            ),
            DayCount
        )
    )
)

Where,

  1. dte_CalMonthDays = Date-picker control name
Calculate number of days in month Power Apps
  • SavePublish, and Preview the app. The text label will display the number of days in a month from the selected date of the date picker.
How to calculate number of days in month Power Apps

Power Apps Get Current and Previous N Month Name

In this section, let us check how to get the current and previous month’s names.

Example:

I have a scenario where I need to add the dropdown values as the current month’s name and the last month’s name, as shown below:

Power Apps get current and previous month name

Follow the below steps to achieve this:

  • On the Power Apps screen, insert a Dropdown control -> Set its Items property to:
ForAll([Today(),DateAdd(Today(),1,TimeUnit.Months)],
    {
        MonthNumber: Month(Value),
        MonthName: Text(Value,"mmmm")
    }
)
Get current and previous month name in Power Apps
  • SavePublish, and Preview the app. Now, the dropdown values will be bound to the current month’s name and the previous month’s name, as shown below:
How to get current and previous month name in Power Apps

Power Apps get the first day of the month

Let us check how to get the first day of the month in Power Apps.

Example:

On the Power Apps screen, I have added a Date-picker control that displays the month’s first day as the default date.

Power Apps get the first day of the month

Follow the below steps to achieve this:

  • On the Power Apps screen, insert a Date-picker control -> Set its DefaultDate property to:
Date(Year(Now()),Month(Now()),1)
How to get the first day of the month in Power Apps
  • SavePublish, and Reload the app. The date-picker will display the first day of the month as a default date, as shown below:
Get the first day of the month in Power Apps

How to add months from start date to get the end date

Let us check how to add months from the start date to get the end date in Power Apps.

Example:

I had a requirement to create a Power Apps form for tracking Project information. When the user completes the form and specifies the month of project duration, the end date will automatically populate based on the start date and project period provided.

Add months from start date to get the end date using Power Apps

For that, I have created a SharePoint list [ACGH Project Details] with various columns like:

Column NameData type
Project IDTitle
Project NameSingle line of text
Manager/ Team LeadPerson or group
Project PeriodChoice [“3,” “6,” “9,” “12,” “18”]
Project Start DateDate and time
Project End DateDate and time
Add months from start date to get the end date Power Apps

I have added an Edit form connected to the above SharePoint list on the Power Apps screen. Upon entering the project period and start date, the project end date will be automatically determined based on the start date and the provided project period.

Power Apps add months from start date to get the end date

Follow the below steps to achieve this:

  • On the Power Apps screen, insert an Edit form -> Set its DataSource property to:
'ACGH Project Details'

Where,

  1. ACGH Project Details‘ = SharePoint list name
Month function in Power Apps
  • Select the Project Period combo box -> Set its OnSelect property to:
Set(
    varEndDate,
    DateAdd(
        DataCardValue12.SelectedDate,
        Value(DataCardValue11.Selected.Value),
        TimeUnit.Months
    )
)

Where,

  1. varEndDate = Provide the variable name.
  2. DataCardValue12 = Date-picker control name [Project Start Date.]
  3. DataCardValue11 = Combo box control name [Project Period.]
How to use Power Apps Month Function
  • Select the Date picker [Project End Date] -> Set its DefaultDate property to:
varEndDate 
Using Power Apps Month Function
  • Once the app is ready, SavePublish, and Preview the app. When the user provides the project period and project start date, the project end date will be automatically selected based on the start date and the provided project period, as shown below:
Add months from start date to get the end date in Power Apps

I completed my requirement by adding months from the project start date to get the end date in Power Apps.

Conclusion

The Power Apps Month function is flexible, allowing both beginners and experienced users to implement it in their Power Apps projects.

This Power Apps tutorial helped you understand the Power Apps Month Function with its syntax and different scenarios, such as getting a month from a selected date in Power Apps, calculating the number of days in a month, and more.

Some more Power Apps article you may also like: