Hi all,
Need some help. I have a Date_Time Value Column from Sharepoint as a card in my view form which looks as follows:
The datacard looks like this:
I have another datacard which looks exactly the same format wise, but the date/time will be further in the future compared to the above date/timestamp, e.g. May 23, 2021 01:50.
What I would like to achieve is the following:
May 23, 2021 01:50 - May 22,2021 11:00 = 14 hours and 50 minutes difference.
How to approach this? seen some examples about datediff and time diff but the combination I could not easily make and I guess I need a combination of those 2 to fix the above. Any help much appreciated!
Dear @WarrenBelz ,
Many thanks for your reply! I have used your code and this would be the result:
With(
{
wDiff:
DateDiff(
DateValue2.SelectedDate +
Time(
Value(HourValue2.Selected.Value),
Value(MinuteValue2.Selected.Value),0
),
DateValue5.SelectedDate +
Time(
Value(HourValue5.Selected.Value),
Value(MinuteValue5.Selected.Value),0
),
Minutes
),
},
Text(RoundDown(wDiff/60,0)) & ":" &
Text(Mod(wDiff,60))
)
However I get an error message from Powerapps:
Expected colon. We expected a colon (:) at this point in the formula. I can't seem to figure out where this should be present, any clue?
I have for the moment split up 2 labels, one with the date diff and the other one with the Text Rounddown and that works so I'm puzzled why the combined version does not work.
Hi @debarbanson ,
Something like this
With(
{
wDiff:
DateDiff(
DateCard1.SelectedDate +
Time(
Value(HourCard1.Selected.Value),
Value(MinuteCard1.Selected.Value), 0
),
DateCard2.SelectedDate +
Time(
Value(HourCard2.Selected.Value),
Value(MinuteCard1.Selected.Value), 0
),
Minutes
),
},
Text(RoundDown(wDiff/60,0)) & ":" &
Text(Mod(wDiff,60)
)
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.