Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.