Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
We are developing a custom connector to read a JSON file from a local location and send it to Power BI. But we are facing an issue with creating a MEZ file. Below I have added the code for the pq file, the same code runs as a blank query in Power BI. How to set up a mez file for the below code with or without authentication? The Mez file fails if "None" is set at authentication. Create a auth setup or no auth to directly load the data we see via blank query.
Attached is the result of the blank query for the same m query.
section PQExtension1;
filePath = "C:\\Users\\ADMIN\\Documents\\navigation2.json";
[DataSource.Kind="PQExtension1", Publish="PQExtension1.Publish"]
shared PQExtension1.Contents = (optional message as text) =>
let
// Read the JSON file
jsonData = Json.Document(File.Contents(filePath)),
// Extract the cube values
cube = jsonData[cube],
// Extract the dimension values
dimension = jsonData[dimension],
// Convert dimension values to a table
dimensionTable = Table.FromColumns(Record.FieldValues(dimension), Record.FieldNames(dimension)),
// Expand the cube values
cubeTable = Table.FromList(cube, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
// Create a new column for each dimension
finalTable = Table.AddColumn(cubeTable, "Dimensions", each dimensionTable)
in
finalTable;
// Data Source Kind description
PQExtension1 = [
Authentication = [
Key = [],
UsernamePassword = [],
Windows = [],
Implicit = [],
None = []
],
Label = Extension.LoadString("DataSourceLabel")
];
// Data Source UI publishing description
PQExtension1.Publish = [
Beta = true,
Category = "Other",
ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
LearnMoreUrl = "https://powerbi.microsoft.com/",
SourceImage = PQExtension1.Icons,
SourceTypeImage = PQExtension1.Icons
];
PQExtension1.Icons = [
Icon16 = { Extension.Contents("PQExtension116.png"), Extension.Contents("PQExtension120.png"), Extension.Contents("PQExtension124.png"), Extension.Contents("PQExtension132.png") },
Icon32 = { Extension.Contents("PQExtension132.png"), Extension.Contents("PQExtension140.png"), Extension.Contents("PQExtension148.png"), Extension.Contents("PQExtension164.png") }
];
Solved! Go to Solution.
Hi @Mohanasudharsan ,
To use a non-certified custom connector:
Put the connector .pq, .pqx, .m, or .mez file in your local [Documents]\Power BI Desktop\Custom Connectors folder. If the folder doesn't exist, create it.
To adjust the data extension security settings, in Power BI Desktop, select File > Options and settings > Options > Security.
Under Data Extensions, select (Not Recommended) Allow any extension to load without validation or warning.
Select OK, and then restart Power BI Desktop.
Reference: Connector extensibility in Power BI - Power BI | Microsoft Learn
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Community Support Team_yanjiang
Hi @Mohanasudharsan ,
To use a non-certified custom connector:
Put the connector .pq, .pqx, .m, or .mez file in your local [Documents]\Power BI Desktop\Custom Connectors folder. If the folder doesn't exist, create it.
To adjust the data extension security settings, in Power BI Desktop, select File > Options and settings > Options > Security.
Under Data Extensions, select (Not Recommended) Allow any extension to load without validation or warning.
Select OK, and then restart Power BI Desktop.
Reference: Connector extensibility in Power BI - Power BI | Microsoft Learn
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best regards,
Community Support Team_yanjiang
Check out the July 2025 Power BI update to learn about new features.