March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Experts ,
I have a requirement to pass the parameter to M Query , below is the M Query generated by KUSTO, i have created a Date parameter in the Power Query , my requirement is to pass theDate parameter to the below code , how can i include the Parameter in the below highlighted area , i tried to append using +, not supporting.
let Source = Json.Document(Web.Contents("https://CLUSTER/rest/query?db=MYDATABASE0&csl=.show version",[Query=[#"csl"="let startTime = datetime(2020-06-20); XXXXTable1 | where EventInfo_Time >=startTime | where Environment == 'Prod' | where Hint == ""LeftNav"" and Value in (""True"",""False"") | extend scenario = iff(Value=='True','Treatment','Control') | summarize eventCount=count(),userCount=dcount(Puid) by bin(EventInfo_Time,1d),scenario",#"x-ms-app"="PowerQuery",#"properties"="{""Options"":{""servertimeout"":""00:12:00"",""query_language"":""csl""},""Parameters"":{},""ClientRequestId"":null,""Application"":null,""User"":null,""PrincipalIdentity"":null,""SecurityToken"":null,""AuthorizationScheme"":null,""RequestHostName"":null,""LocalClusterName"":null,""OriginClusterName"":null}"], Timeout=#duration(0,0,12,0)])),
TypeMap = #table(
{ "DataType", "Type" },
{
{ "Double", Double.Type },
{ "Int64", Int64.Type },
{ "Int32", Int32.Type },
{ "Int16", Int16.Type },
{ "UInt64", Number.Type },
{ "UInt32", Number.Type },
{ "UInt16", Number.Type },
{ "Byte", Byte.Type },
{ "Single", Single.Type },
{ "Decimal", Decimal.Type },
{ "TimeSpan", Duration.Type },
{ "DateTime", DateTimeZone.Type },
{ "String", Text.Type },
{ "Boolean", Logical.Type },
{ "SByte", Logical.Type },
{ "Guid", Text.Type }
}),
Exception = Source[Exceptions]?{0}?,
Result = if (Exception <> null) then
error Exception
else
let
DataTable = Source[Tables]{0},
Columns = Table.FromRecords(DataTable[Columns]),
ColumnsWithType = Table.Join(Columns, {"DataType"}, TypeMap , {"DataType"}),
TableRows = Table.FromRows(DataTable[Rows], Columns[ColumnName]),
LastColumn = Table.ColumnCount(ColumnsWithType) - 1,
TypedTable = Table.TransformColumnTypes(TableRows, Table.ToList(ColumnsWithType, (c) => { c{0}, c{LastColumn} }))
in
TypedTable
in
Result
in KustoQuery
Solved! Go to Solution.
Hi @MokaSatya
You can use " & parameterName & ", this parameter needs to return text or you can use Text.From() function around it.
db=MYDATABASE0&csl=.show version",[Query=[#"csl"="let startTime = datetime(" & ParamiterName & ");
Hi @MokaSatya
You can use " & parameterName & ", this parameter needs to return text or you can use Text.From() function around it.
db=MYDATABASE0&csl=.show version",[Query=[#"csl"="let startTime = datetime(" & ParamiterName & ");
Super, Thanks for the quick solution. it is working
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
12 | |
9 |
User | Count |
---|---|
34 | |
31 | |
20 | |
19 | |
17 |