cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SolarWill
Level: Powered On

Using DateDiff with a SharePoint list

Hello all,

 

Please review the attached image

 

New to PowerApps - I am trying to build a dashboard for metrics for a support desk system that builds logs to a SharePoint lists which is my data source for this project.

 

The problem I am having that when a user creates a ticket and then a moderator acknowledges the ticket, it double time-stamps it, this is almsot like a complete event log - this could create confusion when using DateDiff. So I guess my two questions are:

 

1. Can I use DateDiff and able to ignore a certain entry when calculating the same column/row (example below)

2. If not, how can I filter through it

3. Main question - how can I calculate the difference between the four dates circled in the same column? (the "1" rows are for the same ticket, as well as the "2" rows are its own ticket, too - we need to calculate its pertaining circle)

 

Note: we can use that second column (open/inprogress) to differentiate between the datediff we need to calculate against for #1 and #2.

 

In other words: For circle #1, and #2 - I want to calcuate the date difference for how long it took from the entry to go from "Open" to "In Progress"

 

Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Using DateDiff with a SharePoint list

Hi @SolarWill,

 

I'm not sure that I have fully understand your first 2 question, but here is the answer to your 3rd one.

I suppose that here are the column names of what you have in your screenshot:

Title    Status     xxx    xxx    DateTime

 

1. Insert a dropdown control and set its Items property to:

 

Distinct('List A',Title)

2. Insert a Label to show the datediff value. Set its Text property to:

 

DateDiff(
First(
Filter('List A',Title=Dropdown1.Selected.Value)).DateTime,
Last(Filter('List A',Title=Dropdown1.Selected.Value)).DateTime,
Minutes)

After this, the label would show the difference between two date/time values with different status. The units of result is hours.

Capture.PNG

 

For your reference about DateDiff function:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Using DateDiff with a SharePoint list

Hi @SolarWill,

 

I'm not sure that I have fully understand your first 2 question, but here is the answer to your 3rd one.

I suppose that here are the column names of what you have in your screenshot:

Title    Status     xxx    xxx    DateTime

 

1. Insert a dropdown control and set its Items property to:

 

Distinct('List A',Title)

2. Insert a Label to show the datediff value. Set its Text property to:

 

DateDiff(
First(
Filter('List A',Title=Dropdown1.Selected.Value)).DateTime,
Last(Filter('List A',Title=Dropdown1.Selected.Value)).DateTime,
Minutes)

After this, the label would show the difference between two date/time values with different status. The units of result is hours.

Capture.PNG

 

For your reference about DateDiff function:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-dateadd-datediff

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

SolarWill
Level: Powered On

Re: Using DateDiff with a SharePoint list

Mona,

 

You've answered my question in its entirety - thank-you so much for your help.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,187)