Forum Discussion
Add Index Function causes refresh to fail
- 6 years ago
Try without the column type
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1)
- 6 years ago
Hi darentengmfs ,
As lbendlin said: Removing this newly added optional 5th parameter should solve the issue.
Alternatively you have to update the gateway in the service to the newest version. That should fix the problem as well.
darentengmfs - Can you post the M code from your query, at least the first few lines before and after where you add the Index column? Use Advanced Editor in Power Query editor. Looks like you are pass 5 parameters into a function that max'es out at 4
Otherwise, You could check the Issues forum here:
https://community.powerbi.com/t5/Issues/idb-p/Issues
And if it is not there, then you could post it.
If you have Pro account you could try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".
Hi Greg_Deckler and parry2k
I have accidentally marked your post as solution.
Nonetheless, here are the lines before and after my Index. I have replied my full m script but it was taken down because someone reported it as spam so this would just be the last few lines.
#"Expanded inventItemGroup" = Table.ExpandTableColumn(#"Merged Queries1", "inventItemGroup", {"Item Group"}, {"Item Group"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded inventItemGroup", each ([Item Group] <> "AAA" and [Item Group] <> "BBB") and ([Warehouse] = "100" or [Warehouse] = "200" or [Warehouse] = "300" or [Warehouse] = "400")),
#"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [On Hand] >= 0),
#"Sorted Rows" = Table.Sort(#"Filtered Rows1",{{"Inventory Value", Order.Descending}}),
#"Added Index" = Table.AddIndexColumn(#"Sorted Rows", "Index", 1, 1, Int64.Type)
in
#"Added Index"
Also, I do have Pro license but I have never been able to submit a ticket. I had to go through my Power BI Administrator to submit one.
- parry2k6 years agoSuper User
darentengmfs don't see any issue though. can you remove sort step and then add index. Can you test it, please?
- darentengmfs6 years agoPost Prodigy
Hi parry2k
The sort has to be there before the index column. It is sorted descending on value because I had to get the rolling sum of value from highest to lowest.
- parry2k6 years agoSuper User
darentengmfs hmmm, only for testing...just want to debug this.