Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 9 | |
| 8 | |
| 7 | |
| 7 |