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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Wroclaw
Regular Visitor

We couldn't fold the expression to the data source. -> with REALLY simple query

Hi All,


I'm getting an error We couldn't fold the expression to the data source. Please try a simpler expression. while trying to visualise very simple query, Basically I want to display one column in a table. I have 12 unique values spread across around 1200 rows. My source is Snowflake. In Dual mode it works fine, in DQ it fails.

Wroclaw_0-1711369747047.png

 

M Code:

 

let
    Source = Snowflake.Databases(ServerParameter, WarehouseParameter, [Role=RoleParameter]),
    xyz= Source{[Name="xyz",Kind="xyz"]}[Data],
    xyz= xyz{[Name="xyz",Kind="Schema"]}[Data],
    xyz= xyz{[Name="xyz",Kind="Table"]}[Data],
    #"Renamed Columns" = Table.RenameColumns(xyz,{{"YEAR", "Year"}, {"MONTH", "Month"}, {"ACTUAL_DATE", "Date"}, {"DAY", "Day"}, {"LAST_DAY_OF_MONTH", "Last Day of Month"}, {"DAYNAME", "Dayname"}, {"YEAR_MONTH", "Year-Month"}, {"YEAR_MONTH_LONG", "Year-Month Long"}, {"YEAR_QUARTER", "Year-Quarter"}, {"QUARTER", "Quarter"}, {"MONTHNAME", "MonthName"}, {"MONTH_LONG", "Month Long"}, {"WEEK", "Week"}, {"DAY_LONG", "Day Long"}}),
    #"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each [Date] >= #date(Date.Year(DateTime.LocalNow()) - 2, 1, 1) and [Date] <= #date(Date.Year(DateTime.LocalNow()), 12, 31))
in
    #"Filtered Rows"

 

Any idea what is causing that?

 

Thanks!

1 ACCEPTED SOLUTION
Wroclaw
Regular Visitor

So I found it on my own. When I changed DQ to dual mode I changed the datatype from text to number. Then when I changed storage mode to DQ that setting was remembered and there was probably some type missmatch underhood.

View solution in original post

2 REPLIES 2
Wroclaw
Regular Visitor

So I found it on my own. When I changed DQ to dual mode I changed the datatype from text to number. Then when I changed storage mode to DQ that setting was remembered and there was probably some type missmatch underhood.

DataInsights
Super User
Super User

@Wroclaw,

 

You could use custom SQL and do the column renaming and filtering in SQL:

 

DataInsights_0-1711372628424.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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