ISOWeekNum

How to Use the Power Fx ISOWeekNum  Function in Power Apps

What is the ISOWeekNum Function?

The ISOWeekNum function is a formula function in Power Apps that calculates the week number of a given date based on the ISO 8601 standard. This standard defines that a week starts on a Monday and ends on a Sunday, and the week number is defined as the number of the week within a year.

The ISOWeekNum function takes a date value as input and returns an integer value representing the week number of that date. It is a simple and efficient way to calculate the week number for any date in your Power Apps.

How to Use the ISOWeekNum Function

The ISOWeekNum function can be used in any formula expression in Power Apps, such as in a label, a text box, or a calculated column in a gallery. To use the ISOWeekNum function, you need to provide a date value as input in the following format:


Here, DateValue is the date that you want to calculate the week number for, in the format of a Date/Time value. For example, you can use the Now() function to get the current date and time, or you can use a date picker control to let the user select a date.

To display the ISO week number in a label or a text box, you can set the Text property of the control to the following formula:


This will display the week number preceded by the string "Week ", such as "Week 13" for the 13th week of the year.

Examples of Using the ISOWeekNum Function

Let's look at some examples of how to use the ISOWeekNum function in Power Apps.

Example 1: Displaying the Current Week Number

To display the current week number in a label, you can use the following formula:


This will display the current week number based on the current date and time.

Example 2: Calculating the Week Number for a Selected Date

To calculate the week number for a date selected by the user using a date picker control, you can use the following formula:


Here, DatePicker1 is the name of the date picker control, and SelectedDate is the property that stores the selected date value.

Example 3: Filtering a Gallery by Week Number

To filter a gallery by the week number of a date column, you can use the following formula in the Items property of the gallery:


Here, MyTable is the name of the data source table, DateColumn is the name of the date column that you want to filter by, and 13 is the week number that you want to filter for.

The ISOWeekNum function is a powerful and easy-to-use formula function in Power Apps that allows you to calculate the ISO week number for any date value. Whether you need to display the week number in a label, filter a gallery by week number, or perform any other date-related operation, the ISOWeekNum function is your go-to tool. Try it out in your Power Apps and see the results for yourself!

Power Apps Training Courses by G Com Solutions (0800 998 9248)