Forum Discussion
PowerBIErrorCode: DatasourceAnalysisFailedWithUnknownFunctions
Hi hiruthick-sm,
This error is raised at publish/bind time, before any query runs. When a model is published, the Service statically analyzes your Power Query code to find its data sources, so it can ask for credentials and bind a gateway. "UnknownFunctions" means it hit a source function it doesn't recognize. The usual reason with MongoDB is that the connection was built with something the cloud doesn't have:
custom / third-party connector (.mez in [Documents]\Power BI Desktop\Custom Connectors)
ODBC DSN using a MongoDB BI Connector / ODBC driver installed on your PC
a vendor "MongoDB" connector that isn't certified for the Service
-> works in Desktop (your machine has it) -> Service can't resolve it
-> no bindable data source -> empty visuals + this 400To see which one you used, open Transform data, then Advanced Editor, and look at the function on the Source line:
Odbc.DataSource("dsn=...") / Odbc.Query(...)
-> ODBC driver on your PC -> needs an on-premises gateway with the same driver/DSN
<Vendor>.<Function>(...) from a .mez in Custom Connectors
-> custom connector -> gateway with custom connectors enabled
a connector picked from Get Data that is marked as certified
(e.g. MongoDB Atlas SQL, Azure Cosmos DB for MongoDB vCore)
-> should resolve in the Service; then look at DirectQuery functions insteadFix by case:
ODBC / custom connector
-> install an on-premises data gateway (standard mode) on a machine
that has the same driver/DSN or .mez file
-> gateway settings: "Allow user's custom data connectors" + connector folder
-> Manage connections and gateways -> add the connection
-> semantic model settings -> Gateway and cloud connections -> map it
MongoDB Atlas
-> rebuild the source with the certified MongoDB Atlas SQL connector
(Atlas SQL interface enabled) -> no gateway neededA quick confirmation: open the semantic model's Settings in the Service. If "Data source credentials" is empty or greyed out, it is this binding problem rather than a DirectQuery function-folding issue.
So my overall approach would be:
check the Source function in Advanced Editor
-> ODBC/custom -> gateway with the same driver/.mez -> map the connection
-> Atlas -> certified Atlas SQL connector -> republish
-> verify data source credentials appear in model settingsAI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.