Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have set up a DirectQuery connection with a PostgreSQL database hosted on AWS. I'm able to navigate through the tables and views of my database, and also build basic transformations and measures in Power BI Desktop. I can build some visualizations on top of it as well, however some of the columns cause the following error when used in visualizations:
OLE DB or ODBC error: [Expression.Error] We couldn't fold the expression to the data source. Please try a simpler expression..
I tried to isolate the issue and understand the cause. In particular, any Count Distinct aggregation in the "value" fields of visualiztions causes the above error. Even when I create a new measure with COUNTDISTINCT, the same problem presists. Curiously, a new measure with COUNTDISTINCTNOBLANK works fine, but I don't have any null or blank values in the column that I'm counting.
Is this a bug? Is there a workaround?
PS1: I do NOT have a custom SQL query on the connector
PS2: Even actually complicated queries work well, e.d Percentage of Grant Total Averages, grouped by categories.
PS3: This might be related to this issue, but that one is related to the Amazon Redshift data source.
Power BI Desktop Version: 2.73.5586.561 64-bit (September 2019)
Npgsql-4.0.9
I'm experiencing the same issue with AWS RDS hosted PostgreSQL. Some tables work fine and some complicated measures do go through quite easily, but on some tables or views there seem to be a problem. Some basic queries like querying the store names from a table with 17k records cause an error. That shouldn't be an issue. When I run a similar query in the db theres no errors. Theres only 4 distinct values in that column and if I do a count or distinct count of those values then it works. All the summarizable fields in the that table work fine but text columns don't. On a different table some of the text columns work and some don't.
I actually continued the tests and one weird thing came up. One of the connected tables that I have the problem with is a view in the database. There's a store name and product name fields in the view that aren't working and giving me the aformentioned error message. I took the ddl from that view and created a new query to the database with that views exact SQL statement and surprise surprise those two fields don't give any errors.
What on earth is going on?
To get faster and better technical support for this issue, you may directly create a support ticket.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
104 | |
98 | |
97 | |
38 | |
37 |
User | Count |
---|---|
153 | |
122 | |
75 | |
73 | |
64 |