Forum Discussion
Simple steps not supported in Direct Query - Postgres
- 5 years ago
I just had a call with Microsoft support, we don't understand why it stopped working but we found a way to work around this query folding breaking.
I changed my M code from:
//This code was breaking the folding
let
Source = PostgreSQL.Database(Server, DataBase),
dbo = Source{[Schema="public",Item="gl_summary_union"]}[Data],
#"Renamed Columns" = Table.RenameColumns(dbo,{{"YEAR(b.GL_TRXN_CRTD_DATE)", "Year"}})
in
#"Renamed Columns"========================
To this:
//This code allows Power Bi to fold the query
let
Source = Value.NativeQuery(PostgreSQL.Database(Server, DataBase), "SELECT * FROM public.gl_summary_union", null, [EnableFolding=true]),
#"Renamed Columns" = Table.RenameColumns(Source,{{"YEAR(b.GL_TRXN_CRTD_DATE)", "Year"}})
in
#"Renamed Columns"The weird thing is that the first code worked for a couple of months!
Thanks vanessafvg for your help.
Have a great day
Alejandro
ok so I am just trying to understand the problem.
You were renaming columns in power query before now but suddenly today it started breaking.
Something needs to have changed? Were you delayed in noticing after the last update? Otherwise what created this problem when it was fine before?
I just had a call with Microsoft support, we don't understand why it stopped working but we found a way to work around this query folding breaking.
I changed my M code from:
//This code was breaking the folding
let
Source = PostgreSQL.Database(Server, DataBase),
dbo = Source{[Schema="public",Item="gl_summary_union"]}[Data],
#"Renamed Columns" = Table.RenameColumns(dbo,{{"YEAR(b.GL_TRXN_CRTD_DATE)", "Year"}})
in
#"Renamed Columns"
========================
To this:
//This code allows Power Bi to fold the query
let
Source = Value.NativeQuery(PostgreSQL.Database(Server, DataBase), "SELECT * FROM public.gl_summary_union", null, [EnableFolding=true]),
#"Renamed Columns" = Table.RenameColumns(Source,{{"YEAR(b.GL_TRXN_CRTD_DATE)", "Year"}})
in
#"Renamed Columns"
The weird thing is that the first code worked for a couple of months!
Thanks vanessafvg for your help.
Have a great day
Alejandro
- vanessafvg5 years ago
Community Champion
no problem glad its sorted