Forum Discussion
Anonymous
4 years agoNot applicable
Token identifier expected before if condition
(APIInsightsID as text)=> (Counter as number)=> let Source = Excel.CurrentWorkbook(){[Name="Table23"]}[Content], ID = Table.TransformColumnTypes(Source,{"App Insight ID ", type text}), APIInsigh...
v-kkf-msft
Community Support
4 years agoHi Anonymous ,
You need to assign the IF statement to a variable. And in your code, the red circles are not recognized by PowerQuery.
Since I'm not sure of the exact output you want to achieve, I've only created a code that can be executed.
(APIInsightsID as text)=>
(Counter as number)=>
let
Source = Table,
ID = Table.TransformColumnTypes(Source,{"App Insight ID ", type text}),
APIInsightsID = "",
Counter = 1,
condition = if Counter > ID[Index]{0} then APIInsightsID
else if ID[App Insight ID] <> APIInsightsID then Counter+1
else APIInsightsID = ID[App Insight ID]
in
condition
Best Regards,
Winniz