Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
DrBiker
Advocate II
Advocate II

Redshift and data folding error

I am using a redshift database, and I can connect to that OK in Power BI Desktop.  My problem comes when I try to use some calculated fields; I have simplified some down to try and find the error so for example:

     Measure 2 = COUNT(evhc[flag]) 

 

Where flag is an integer.  This give the error:

     OLE DB or ODBC error: [Expression.Error] We couldn't fold the expression to the data source. Please try a simpler expression.

 

I assume that when folding this query that Power BI is using SQL syntax rather than Redshift?

 

Is this a bug or am I missing something?

 

p.s. I know I can do this without using a measure, but this is a test as my measures are more complex than this.

 

 

1 ACCEPTED SOLUTION
pqian
Microsoft Employee
Microsoft Employee

@DrBiker I'm assuming you are connecting to RedShift in DirectQuery mode. This error is thrown when some aggregation (in this case the count) is been translated to M for execution, so it's not really SQL yet. 

 

I think this is related to a bug that we know about, is [flag] a nullable column? Counting on nullable column wasn't working in the preview bits, we will be fixing it in the next release.

View solution in original post

5 REPLIES 5
WaqasP
Regular Visitor

Has this been resolved?

pqian
Microsoft Employee
Microsoft Employee

@DrBiker I'm assuming you are connecting to RedShift in DirectQuery mode. This error is thrown when some aggregation (in this case the count) is been translated to M for execution, so it's not really SQL yet. 

 

I think this is related to a bug that we know about, is [flag] a nullable column? Counting on nullable column wasn't working in the preview bits, we will be fixing it in the next release.

arify
Microsoft Employee
Microsoft Employee

@pqian is right, this should be fixed in the next release (~end of august). Thanks

Hi,

 

I am getting the same error message (although different DAX formula!!!

 

Is this fixed or not?

 

Thank you!

MattAllington
Community Champion
Community Champion

Redshift is in preview mode, so I guess it is a bug.    Send a frown using the desktop frown so the developers can look at it.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.