cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kaschlegel
Helper I
Helper I

Date Difference

I have two date pickers (startdate, enddate).

Where would I fit the datediff into this string, please?  Thanks for whatever 

knowledge you can share.

Sort(
   AddColumns(
      GroupBy(
         'FLMA Tracking',
         "Dept",
         "Station",
         "OtherData"
      ),
      "Hours",
      Sum(OtherData,HoursUsed)
   ),
   Station
)
1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@Kaschlegel 

You've not provided a lot of detail on what you are trying to do, so I will just assume you are using datepickers to filter out a range of dates from the results of your table.

If so, then the following formula should assist.

Sort(
   AddColumns(
      GroupBy(
         Filter('FLMA Tracking',
             dateCol >= startDate.SelectedDate && 
             dateCol <= endDate.SelectedDate
         ),
         "Dept",
         "Station",
         "OtherData"
      ),
      "Hours",
      Sum(OtherData,HoursUsed)
   ),
   Station
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

2 REPLIES 2
RandyHayes
Super User III
Super User III

@Kaschlegel 

You've not provided a lot of detail on what you are trying to do, so I will just assume you are using datepickers to filter out a range of dates from the results of your table.

If so, then the following formula should assist.

Sort(
   AddColumns(
      GroupBy(
         Filter('FLMA Tracking',
             dateCol >= startDate.SelectedDate && 
             dateCol <= endDate.SelectedDate
         ),
         "Dept",
         "Station",
         "OtherData"
      ),
      "Hours",
      Sum(OtherData,HoursUsed)
   ),
   Station
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

WarrenBelz
Super User III
Super User III

Hi @Kaschlegel ,

You did not specify the field, but it would go in here

Sort(
   AddColumns(
      GroupBy(
Filter( 'FLMA Tracking',
DateDiff( . . . .
), "Dept", "Station", "OtherData" ), "Hours", Sum(OtherData,HoursUsed) ), Station )

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (22,451)