Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I try to invoke a custom function.
While digging into a case I found that this seems to be related to reading files from sharepoint.
There are 3 files
And a simple function:
which for some files is not working properly not finding file
Apologies, I did not properly read you problem description.
I did so now...
What you are trying to do is very doabale and I have a lot of experience with processing sharepoint files.
It does need debugging.
What I normally do is to replace the "in" clause of the function that is giving trouble with the and intermediairy steps until I found the issues. This way you can see where it goes wrong and you can gradually develop your function.
Like
let
x = 1,
y = 2,
result = x + y
in
X
As a first, I would like to see the output of the "Filtered Rows1" step.
Common cause for mismatches in filtering are:
In adition I have some immediate questions:
how was the result below produced?
In the above result, if you click in the white space to the right of the word Table, What shows up at the bottom of the screen?
Why is there a "Filtered Rows1 step in here?
AND
I would take a slightly different approach (I don't have access to sharepoint at the moment, so there may be small mistakes):
= Table.AddColumn(#"Changed Type", "Survey result", each #"Survey result grab"([Sharepoint Files.Content]))
This wil also save you repeating calls to Sharepoint.Files() which can be very slow on large sharpoint sites.
Hope this helps...
Thanks for support. I am preetu sure it is a bug in a Power BI. I wrote the function to compare filename with calculated filename.
For some files it is working fine
and for some it is not
I copied both values from 2nd row to column in excel and I removed duplicates. Those cells are equal, and comparision is not working fine. On a screen there are different types, but it does not change anything.
Hm. I find it highly unlikely this is a bug in powerquery. Comparisons are fundamental for the reliability of PowerQuery. I have not heard anyone else about this bug or encountred it myself.
My proffesor in college always said: "don't blame the compiler, debug your program."
The screenshots you send show something, but without seeing all the M code leading to it, I can not help you. In your situation I would start with trying to replicate the issue with local files (with Folder.File()). I could try this as well...
And try some of the tips I gave you earlier.
The quicker method is probably to use my suggestion to solve this with a merge though. This has other benefits as well.
Here is your problem:
Change to:
= Table.AddColumn(#"Changed Type", "Survey result", each #"Survey result grab"([Survey result]))
@PwerQueryKees I do not think so [Survey temp] is a column with parameters to pass to the function. This part is correct. Anyway when I changed as you advised there was an error
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
13 | |
7 | |
6 | |
6 |