Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
MXSven
Helper I
Helper I

issue with M language statement

 

Hi Everybody

 

it seems that there is a dependency between StartDatum and EndDatum, means I am reducing the value of the EndDatum variable,

but then appearently the StartDatum is equal to EndDatum.

 

Any Ideas ?

 

Screenshot 2022-08-08 170055.jpg

 

Is there a way of debugging modus in the advanced editor, where I can see what the value in each step of the variable is ?

 

2 REPLIES 2
artemus
Microsoft Employee
Microsoft Employee

It looks like you have start and end reversed as normally start is less than end, but you are assigning end to start minus 5 days.

 

As far as debugging goes, you could replace the let ... in #"ChangedType1" with [ ... ], which will turn your let statement into a record containing the value of each variable in the let ... in statement.

thanks for your feedback,
below find the adusted code and it's outcoming

 

let

    Source = (Wertpapierkurs as text ) as table =>

 

let

 

CurrentReference_number = Duration.TotalSeconds(DateTime.From(Date.From(DateTimeZone.SwitchZone(DateTimeZone.LocalNow(), 0))) - #datetime(1970, 1, 1, 0, 0, 0))*60*60*24,

CurrentReference = "=" & Text.From(CurrentReference_number),

HistoricDataReference = "=" & Text.From(CurrentReference_number-60*60*24*5),

 

    Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/"&Wertpapierkurs&"?period1"&HistoricDataReference&"&period2"&CurrentReference&"&interval=1d&events=history&includeAdjustedClose=true"),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),

    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),

    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}}),

    #"Changed Type with Locale" = Table.TransformColumnTypes(#"Changed Type", {{"Open", type number}, {"High", type number}, {"Low", type number}, {"Close", type number}, {"Adj Close", type number}}, "en-US"),

    #"Changed Type1" = Table.TransformColumnTypes(#"Changed Type with Locale",{{"Volume", Int64.Type}})

in

    #"Changed Type1"

in

    Source

 

 

MXSven_0-1660050705032.png


as you can see in the error message, something is not right
and I have no idea, why the values are equal.

Any ideas ?

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.