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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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