Get Current Quarter From Date In Canvas PowerApps

Introduction

In this article, we will see how to get the current Quarter from Date from Canvas PowerApps.

Implementation Steps

1. Navigate to https://make.powerapps.com

Get Current Quarter From Date In Canvas PowerApps

2. Select Apps --> Select New App --> Select Canvas

3. Once Page opens input the name and select Tablet or Phone depending on your requirement, from my end I am selecting Tablet Mode

Get Current Quarter From Date In Canvas PowerApps

4. Once Page is opened  --> Add a Label by selecting (Insert --> Label) and add a Button as well

Get Current Quarter From Date In Canvas PowerApps

5. Now select the Button and go to OnSelect and write below code logic

Get Current Quarter From Date In Canvas PowerApps

Code for converting Date to Quarter

If(
    Month(Now())<=3,
        Set(getQuarterFromDate,"1"),
    Month(Now())>=04 && Month(Now())<=06,
        Set(getQuarterFromDate,"2"),
    Month(Now())>=07 && Month(Now())<=09,
        Set(getQuarterFromDate,"3"),
    Month(Now())>=10,
        Set(getQuarterFromDate,"4")
)

6. Now set the default value to getQuarterFromDate

7. Now click on the Button

Get Current Quarter From Date In Canvas PowerApps

You will see the current Quarter value

Conclusion

By using the code which I have attached we can convert the current date to a Quarter.


Similar Articles