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
(APIInsightsID as text)=>
(Counter as number)=>
let
Source = Excel.CurrentWorkbook(){[Name="Table23"]}[Content],
ID = Table.TransformColumnTypes(Source,{"App Insight ID ", type text}),
APIInsightsID = "",
Counter = 1,
if Counter > ID.RowCount
then APIInsightsID,
else
if ID."App Insight ID " != APIInsightsID
then
Counter+=1,
APIInsightsID = ID."App Insight ID ",
@CheckAPI
in
ID
Hello everyone I'm new in writing power queries, and I don't know why I get this error before if condition, do anyone know why? Kind regards Branislav
I want to iterate through a column, because while simply don't work, while is unrecognizable command.
Hi @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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |