Quick Note, I have reviewed these threads and they do not fix my issue:
( Outdated info, see documentation below ) Access Snowflake query results through PowerBI
( I would expect this to fix my issue, but it does not ) How to write a Snowflake SELECT statement query in Advance Editor from powerBi
Hi All,
When attempting to query snowflake with a native query, I get this error:
These are the parameters:
I have verified the credentials / tables / databases / schemas are correct by connecting to directly to one table at a time, but simple queries like the screenshot and complex queries all return this message "native queries aren't support by this value".
I know this is a new feature ( June 2021 ) and I have read the documentation here: https://learn.microsoft.com/en-us/power-query/connectors/snowflake#connect-using-advanced-options
EDIT:
I have tried the following query formats:
SELECT * FROM "MyDatabase".PUBLIC.ITEMSTABLE
SELECT * FROM "MyDatabase"."PUBLIC".ITEMSTABLE
SELECT * FROM "MyDatabase"."PUBLIC"."ITEMSTABLE"
I believe that this may be due to my MyDatabase being case sensitive and PowerBI stripping the quotes around it in the query.
In snowflake, this query succeeds while the same query in PowerBI fails:
SELECT * FROM "MyDatabase".PUBLIC.ITEMSTABLE
Issue opened with Microsoft here:
https://community.powerbi.com/t5/Issues/Unable-to-query-case-sensitive-Snowflake-tables/idc-p/2030983
Any help is appreciated.
Most likely the query provided in message box is terminated with semicolon. It should be removed from the source query:
And actual query sent to Snowflake:
As we can see it is wrapped with outer query so any kind of input that makes the full query invalid one will error out.
I had similar issue with Native query written using Dataverse as Datasource. PowerBI Refresh was successful on the power bi desktop but refresh was failing on powerbi server. It was fixed for me when I have appended [EnableFolding=false] keyword in the native query. I have attached the screenshot for a reference of what i have modified. Hope this will help someone
enter image description here
Regards,
Mohith
It has been confirmed by a Microsoft ticket that my issue was that I had a case sensitive database name. The solution from MS was to... Not have a case sensitive DB name.
Related
I am trying to repoint the data Source of a power Bi dashboard from SQL to Snowflake.
So far, for most of the tables worked. However, I got one table on which I got the following error when changing the data source:
Expression.Error: 'Query' are not valid Snowflake options. Valid options are: 'ConnectionTimeout, CommandTimeout, CreateNavigationProperties, Role'
This specific query ( from Advance Editor in PowerBi) contains a simple select and it looks as follows:
let
Source =Snowflake.Databases("serverabc", "abc", [Query="SELECT DateLabel, SnapshotDate, Future, Latest#(lf)FROM Xtable#(lf)WHERE DateLabel IS NOT NULL#(lf)GROUP BY DateLabel, SnapshotDate, Future, Latest", CreateNavigationProperties=false]),
#"Filtered Rows" = Table.SelectRows(Source, each true)
in
#"Filtered Rows"
The select statement works in both SQL and Snowflake but I am having difficulties on how to translate this in Power BI as well.
Thank you in advance
EDIT:
PowerBI June
Snowflake (updated connector)
We are adding the highly demanded Custom SQL support for the Snowflake connector. Like the SQL connector, this will let you input a Snowflake native query and then build reports on top of it. This will work with both Import and Direct Query mode.
https://powerbiblogscdn.azureedge.net/wp-content/uploads/2021/06/snowflake_update.png
Expression.Error: 'Query' are not valid Snowflake options. Valid options are: 'ConnectionTimeout, CommandTimeout, CreateNavigationProperties, Role'
It seems that the previous source was supporting "custom query".
Sql.Database
function (server as text, database as text, optional options as nullable record) as table
Query : A native SQL query used to retrieve data. If the query produces multiple result sets, only the first will be returned.
PowerBI connector to Snowflake does not support such option:
Snowflake.Databases
function (server as text, warehouse as text, optional options as nullable record) as table
options, may be specified to control the following options:
ConnectionTimeout: The number of seconds to wait for network responses from Snowflake.
CommandTimeout: The number of seconds to wait for a query to execute.
There is active ticket: Snowflake connector -> add SQL statement as optional.
Possible workarounds:
Create a view in Snowflake that wraps the query and use it instead
Access the table content and perform the filtering/aggregation in
PowerQuery
Good evening!
We are currently having an issue with the below error being thrown when trying to refresh a dataset via the on-premises gateway. Refreshing direct through Power BI desktop does not provide any errors and seems to refresh fine.
Data source error: {"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError",
"pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError",
"parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode",
"detail":{"type":1,"value":"-2147467259"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage",
"detail":{"type":1,"value":"The key didn't match any rows in the table."}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult",
"detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ValueError.Key",
"detail":{"type":1,"value":"[entity = \"Forecast\"]"}},{"code":"Microsoft.Data.Mashup.ValueError.Reason",
"detail":{"type":1,"value":"Expression.Error"}}],"exceptionCulprit":1}}} Table: FACT - Cost Forecast Tool.
Cluster URI: WABI-EUROPE-NORTH-B-redirect.analysis.windows.net
Activity ID: f4b629a6-a9bc-4966-954c-ae37139737a4
Request ID: db16cb6d-a765-1e0e-f9f5-b8803c8baa6e
Time: 2020-11-25 17:20:30Z
From reading previous posts, I'm not sure any of the normal responses apply in this scenario, as they tend to relate to either pulling data from SQL Server, or Excel files (where the sheet name causes an issue).
The table throwing the error (FACT - Cost Forecast Tool) is made by appending two other tables - one comes from a Power BI dataflow (Forecast), and one from a folder import of CSV files (Forecast Tool Adjustments).
Publishing a model with just the two individual tables (Forecast and Forecast Tool Adjustments) works and refreshes fine.
The above error only occurs where a third table is added combining these two tables via a one liner in Power Query:
= Table.Combine({#"Forecast Tool Adjustments", Forecast})
Oddly the value being flagged in the error, "[entity = "Forecast"]", is one of the first steps in Power Query for the 'Forecast' table. So while that table refreshes fine if it's on it's own, it seems to throw an error when refreshed through the combined table?
Any thoughts would be greatly appreciated.
My report was running normally yesterday but now the report on power bi service gives an error of A query failed due to an invalid table, column, or object name.
The gateway is online and doesn't seem to have any issues regarding that.
The report works fine on power bi desktop.
I could not figure out the exact issue for this error.
Could anyone please help me figure this out?
This is what I Get from show details
Not much detail here.
The solution to my question was simple. I work on the .pbix on my local machine and deploy the .pbix to the service linking live database from RDP.
The issue was column name difference in the local database and the live database.
I figured this out by comparing each tablename and columnname for all the tables in both databases.
I'm new to Power BI (Free Version) and I have been asked to develop a report system which generates report from an excel sheet, the reports work good for only the data I have collected.
but my question is how to connect to the data immediately from SQL server without the need to convert it to excel and then import it in power BI, I also want the data to be refreshed dynamically.
One of the solutions I tried is to add new dataset but I get the following message:
Refresh can't be scheduled because the data set doesn't contain any
data model connections, or is a worksheet or linked table. To schedule
refresh, the data must be loaded into the data model.
I have looked for many solutions but none has worked.
am I missing a concept? thank you
If this data is stored in a SQL SERVER table it is a pretty straight forward process.
When you create a new power bi report (.Pbix) you should see a prompt asking you if you want to "Get Data". You would select the 'SQL Server Database' option - See the image below:
Then, you will be asked to enter the Server and Database name, and to specify either 'Import' or 'Direct Query' mode. If you choose 'Import' the data will be refreshed every time you access the report or upon 'Refresh' within a report session. If you choose the latter, the connection will always be live i.e. any changes to the data in your database will be reflected in the report.
Once you get passed this window, you will be asked to either specify credentials or use a windows authentication to access the database and server. After that you can either specify a query to pull in some data or you can select from a list of tables.
I hope this helps!!
I am using Power BI API.
I've got a dataset with some tables and rows.
From Power BI API Console I don't have any issue when retrieving datasets or tables.
However the PUT verb on a table resource to update its schema always returns a 504 - Proxy request timed out
It's the first time I use Apiary IO so it might be its problem and not Power BI update, but that leads me to some questions:
Is there any workaround to test Power BI with, for example, Fiddler? I can type the url and body but I will need an Authorization header with the OAuth2 token if I'm not mistaken. How can I get that? ApiaryIO seems to hide it.
As per Update Schema Documentation the URL with the resource is https://api.powerbi.com/v1.0/myorg/datasets/{myDatasetId}/tables/{myTableName}
and the verb is a PUT. What is then the meaning of the "name": "???" parameter that goes in the JSON body? Is it the table's name or something else? I am assuming it's the table name but it seems redundant as I am already accessing the resource {myTableName} as per the given URL.
And my last related question is how to rename a specific table's column without modifying its data? This is what I'm trying to achieve by updating the schema but I don't understand how does Power BI know what column I am trying to rename.
Thank you!
Sorry that you're having trouble. You can get a token in two ways -the right way is to create an app in AAD (here's how). The wrong way ;) is to open the Power BI.com service, in a browser then open fiddler, then press F5 to reload. You should be able to see the Access Token in various requests. If you register an app, you can plug in your App's information in one of the samples we have https://powerbi.microsoft.com/developers, see client app or web app.
The name you provide in the table is the friendly human readable name that appears in the UI when you're building a report. Without it the system is unusable by humans :).
Let me get back to you on #3.
Calling PUT table will attempt to save upgrade the table without loosing any data (unless you removed columns). If it can't, it will return a conflict error. If you still want to update the table schema, you would have to delete the rows and call PUT table again. There is currently no direct way to rename a column. PUT table would treat it like a delete and add for that column. You would loose the data in that column but not the whole table.