Monday, April 4, 2022

How to find Difference between two dates in Days with calculated fields in Model Driven Apps

Introduction:


In this Blog, we will see how to find difference between two date in Days using Calculated fields in Model Driven Apps.


Implementation Steps:

 

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

 

2. Click Solutions (if Already Available) else create a new Solution and add New Table or Existing Table

 

3. Create a new Field inside that Table (Start Date)

 

rampprakash_0-1649055496006.png

 

4. Create another field called End Date 

 

rampprakash_1-1649055496009.png

 

5. Save the Table

 

6. Create a Whole Number Field as Calculated

 

rampprakash_2-1649055496013.png

 

7. Click Calculation --> It will save the table and open a Separate Tab.

 

8. Once the Page Opens add following Condition

  •    Start Date Contains Data
  •    End Date Contains Data

9. Add DiffInDays (It is used to find difference between two dates)

 

10. Write below Query in the Action Field

 

DiffInDays(cr2f9_startdate, cr2f9_enddate)

 

rampprakash_3-1649055496016.png

 

11. Now add 

  • Start Date
  • End Date
  • Difference in Date 

Fields into the Form.

 

12. Open a new Record and Input Date and Click Save

 

Positive Number : (End Date is Future)

 

rampprakash_0-1649055863103.png

 

 

Negative Number : (End Date is Past)

 

rampprakash_0-1649055768894.png

 

 

That's it :slightly_smiling_face:

No comments:

Post a Comment

How to Clear Cache in Canvas PowerApps while working on Offline mode?

  Introduction In this blog, we’ll look at how to clear cache in Canvas Apps when using the Power Apps mobile application, especially when t...