LowCodeGo logo

Power Apps – Default Dates by Week, Month, Quarter & Year

Overview

Setting default dates in Canvas Apps is simple formulas using the formulas mentioned below. By going to the DefaultDate property or your date field, you will be able to set the date based on your needs.

update default date property

Today/Tomorrow

Today

When adding a date to a screen, by default the date is set to today with the function:

Today()

Tomorrow

If you want to set tomorrow, you will need to use the following formula:

Today() + 1

It’s very easy to add/minus days from a date using this method.

Week

Find the upcoming Monday, Friday, Saturday etc., the following functions will be utilized:

  • Weekday() – finds the numeric value for the day of week
  • StartOfWeek.X – used to define the starting day of week ex) if set to StartOfWeek.Saturday, Saturday will return of value 1 and Friday will return value of 7
  • Abs() function will provide us the absolute (positive) value of any negative number

Upcoming Friday

If you want to set to the upcoming Friday, the following formula can be used:

Today() + Abs(Weekday(Today(), StartOfWeek.Saturday) - 7)

Using the various functions identified above, all that’s being done if adding the days difference between today and Friday.

Upcoming Monday

If you want to set to the upcoming Monday, the following formula can be used:

Today() + Abs(Weekday(Today(), StartOfWeek.Tuesday) - 7)

Month

The following functions can be used to default to end of month or first day of next month:

  • Date() – Pass along the year, month and day values to set a date
  • Year() – Pass an integer for the year value
  • Month() – Pass an integer for the month value

End of Month

The formula below identifies to the first day of the next month. At the end of the formula there is a -1 that adjusts the date to the last day of the previous month:

Date(Year(Today()), Month(Today()) + 1, 1) -1

Next Month (1st Day)

The formula below identifies to the first day of the next month:

Date(Year(Today()), Month(Today()) + 1, 1)

Next Month (Last Day)

Date(Year(Today()), Month(Today()) + 2, 1) -1

Quarter

To identify the quarter end or quarter start date, the month will need to be checked. By identifying what quarter you’re in, you will be able to see the date accordingly.

End of Quarter

If(Month(Today()) in [1,2,3],
    Date(Year(Today()), 3, 31),
    If(Month(Today()) in [4,5,6],
        Date(Year(Today()), 6, 30),
        If(Month(Today()) in [7,8,9],
            Date(Year(Today()), 9, 30),
            Date(Year(Today()), 12, 31)
        )
    )
)

Next Quarter (1st Day)

If(Month(Today()) in [1,2,3],
    Date(Year(Today()), 3, 31) + 1,
    If(Month(Today()) in [4,5,6],
        Date(Year(Today()), 6, 30) + 1,
        If(Month(Today()) in [7,8,9],
            Date(Year(Today()), 9, 30) + 1,
            Date(Year(Today()), 12, 31) + 1
        )
    )
)

Next Quarter (Last Day)

If(Month(Today()) in [1,2,3],
    Date(Year(Today()), 6, 30),
    If(Month(Today()) in [4,5,6],
        Date(Year(Today()), 9, 30),
        If(Month(Today()) in [7,8,9],
            Date(Year(Today()), 12, 31),
            Date(Year(Today()) + 1, 3, 31)
        )
    )
)

Year

Setting to end of year or first day of next year is simple with the following formulas:

End of Year

Date(Year(Today()), 12, 31)

Next Year (First Day)

Date(Year(Today()) + 1, 1, 1)

Comments

  1. […] DefaultDate is a perfect starting point to see a default date for your end users. Using simple formulas you can move the date out a day, a week, or even a month out without having users to intervene. Setting a default date can be complex, you can refer to the following tutorial that dives into the various options in depth: https://lowcodego.com/2023/01/27/power-apps-default-dates-by-week-month-quarter-year/ […]

Leave a Reply to 10 Tips Using Date Picker in Canvas Apps - LowCodeGoCancel reply

Categories

Follow us

Copyright ©LowCodeGo 2025

Discover more from LowCodeGo

Subscribe now to keep reading and get access to the full archive.

Continue reading