Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
We'd like Power BI Desktop to understand a custom file format and for users to be able to select a file of that type and have Power BI Desktop open it (generating probably multiple tables). Were I'm currently at with this is trying to create a custom connector for this and coming up against a number of issues. So a general question - is a custom connector the right way to go, or is there some other way to open a particular file type and have Power BI apply some Power/M query to extract the relevant data (bearing in mind the ideal is for the user to be able to select a file and have the data appear without delving into any data manipulation themselves)?
One of the issues I'm getting is with credentials - relevant section of code below. Accessing a test file using Visual Studio to debug (e.g. PQExtension1.Contents("\\path\to\test\file")) requests credentials when first running for Data Source Kind PQExtension1 (I select 'Windows' and Set Credential), but then requests credentials again when running subsequently, this time for Data Source Kind File. How to reuse the credentials previously entered?
section PQExtension1; [DataSource.Kind="PQExtension1", Publish="PQExtension1.Publish"] shared PQExtension1.Contents = (path as text) => let Source = Xml.Tables(File.Contents(path)), pkg = Source{0}[pkg], pkgNav = GetLevelAsTable(pkg) //not getting as far as this in pkgNav; PQExtension1 = [ Authentication = [ Windows = [] ], Label = Extension.LoadString("DataSourceLabel") ];
...
So - is there a better way than custom connector and if not, can I reuse those credentials?
Many thanks
Craig
Hi Craig,
After a lot of tests, I'm afraid the Xml.Tables could be unsupported for now. Please refer to docs/m-extensions.md#data-source-functions.
>>> Currently, a limited set of data source functions have been enabled to support extensibility.
Best Regards,
Dale
Thanks Dale (many thanks for the lot of tests!). So no to the custom connector route. Is there any means of using a particular M/power query to load a file with a specific extension though (or something similar)? E.g. .xyz files open (get pre-processed, effectively) with XYZ.pq.
I've raised this as a feature request - also sounds similar to this other feature request re applying query to file based on some filename pattern.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
20 | |
3 | |
2 | |
2 | |
2 |