Forum Discussion
2 Errors: Unknown column and Key not present in dictionary
Dear pqian
Thank you for your reply.
As my previous reply to Nhallquist, I got it to work somehow.
Now I'm dealing with the "Key not present in the dictionary" error.
Here are the scripts in [Advanced Query Editor] as you mentioned.
Table : upstream_world_fields
let
Source = MySQL.Database("localhost", "db_energy", [ReturnSingleDatabase=true]),
db_energy_upstream_world_fields = Source{[Schema="db_energy",Item="upstream_world_fields"]}[Data]
in
db_energy_upstream_world_fieldsPower BI Message : No syntax errors have been detected.
And all the tables have exactly same script as above, only with different table names.
Power BI messages are the same about all tables, saying "No syntax errors have been detected."
Here is the table name list
And the `upstream_world_~` tables are related as below.
<Relation among tables>
upstream_world_fields
upstream_world_plays
upstream_world_reservoirs (2 foreign key constraints, referencing to `~_fields` and `~_plays`)
upstream_world_interests (1 foreign key constraint, referencing to `~_reservoirs`)
upstream_world_events (1 foreign key constraint, referencing to `~_interests`)
upstream_world_costs (1 foreign key constraint, referencing to `~_events`)
upstream_world_reserves2P (1 foreign key constraint, referencing to `~_costs`)
upstream_world_production (1 foreign key constraint, referencing to `~_reserves2P`)
About "View Native Query" you mentioned, it was not active for both "Source" and "Navigation" so I couldn't click it.
See the screenshot below.
And finally, clearing cache didn't help it unfortunately.
It sounds like you are still having the same issues with the "Key not present" errors. Let's start at the beginning. Can you check the database that you are accessing and make sure that the account you are logged in as, and the account that is running PowerBI both have READ access to the tables and columns? Not familiar with that database, but this is where I would start, since the script syntax is correct.
- ngkim10 years agoRegular Visitor
Dear Nhallquist
Thank you for your reply.
I am always logging in database with root account, and Power BI can read all the tables as you can see below.
As my earlier post, I can get the data from the first 3 tables only.
- pqian10 years ago
Microsoft Employee
ngkim this doesn't make any sense...
If you delete everything and just leave this step:
Source = MySQL.Database("localhost", "db_energy", [ReturnSingleDatabase=true])You see the base navigation table right? Next, if you click on the link inside the table, what happens?
is db_energy your database name AND your schema name?