0
votes

Came across this from an issue I appear to be having with the power query editor, tried different options but this appears to be closest to the issue I am having when editing time/ duration over 24 hours.

Please accept my apologies, fairly new to power query editor.

I have attached a screenshot of the error I am receiving any belongings is much appreciated.

More information can be provided if needed.

When I click show error the second ‘let’ highlights and token eof error appears, assuming this is something to do with parentheses or commas in the query.

error message

1
Please edit your question with the code as text. - BigBen
Why do you have two lets in the same query? - Alexis Olson

1 Answers

0
votes

The Power Query can only have 1 top-level let expression. You'll want to structure your query like this. Edit in the advanced editor

let
    Source = ...,

    DurationFromYourText = (text as text) as duration =>
        let
            Duration = ...
        in 
            Duration,


    Invoked = DurationFromYourText()
in
    Invoked

Trouble over 24 hours

That's because 128 hours is an invalid value 128:22:13. If you're in-range then the built-in formatter works

Duration.FromText("5.08:22:13")

Duration.FromText says it uses the format

(-)hh:mm(:ss(.ff))
(-)ddd(.hh:mm(:ss(.ff)))


(All ranges are inclusive)
ddd: Number of days.
hh: Number of hours, between 0 and 23.
mm: Number of minutes, between 0 and 59.
ss: Number of seconds, between 0 and 59.
ff: Fraction of seconds, between 0 and 9999999.