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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Indika156
Frequent Visitor

Advanced Editor

Hi 

I need to load the specific columns and rows from the table (ODBC Progress db) , I dont want all the columns and rows to load ,

I know how to get the columns but dont know how to include the filtering coding in the same syntax 

 

Filtering after all columns loaded is not the solution , it should only takes the filtered rows

 

let
Source = Odbc.DataSource("dsn=stix", [HierarchicalNavigation=true]),
STIX_Database = Source{[Name="STIX",Kind="Database"]}[Data],
PUB_Schema = STIX_Database{[Name="PUB",Kind="Schema"]}[Data],
trndet_Table = PUB_Schema{[Name="trndet",Kind="Table"]}[Data],
Sales = Table.SelectColumns(trndet_Table,{"id_branch", "id_maj_grp_prod","cost_line","sell_line","date_invoiced"}),
Sales=Table.SelectRows(#"sales", each [date_invoiced] > #date(2018, 5, 1))
in
#"Sales"

 

 

The above is the syntax and bold is the row filtering , how can I joing thees two , please help me 

1 ACCEPTED SOLUTION

Hi @Indika156,

 

Please use below query: 

 

let
Source = Odbc.DataSource("dsn=stix", [HierarchicalNavigation=true]),
STIX_Database = Source{[Name="STIX",Kind="Database"]}[Data],
PUB_Schema = STIX_Database{[Name="PUB",Kind="Schema"]}[Data],
trndet_Table = PUB_Schema{[Name="trndet",Kind="Table"]}[Data],
Sales2=Table.SelectRows(Table.SelectColumns(trndet_Table,{"id_branch", "id_maj_grp_prod","cost_line","sell_line","date_invoiced"}), each [date_invoiced] > #date(2018, 5, 1))
in
Sales2

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @Indika156,

 

You can modify the Power Query below: 

 

let
Source = Odbc.DataSource("dsn=stix", [HierarchicalNavigation=true]),
STIX_Database = Source{[Name="STIX",Kind="Database"]}[Data],
PUB_Schema = STIX_Database{[Name="PUB",Kind="Schema"]}[Data],
trndet_Table = PUB_Schema{[Name="trndet",Kind="Table"]}[Data],
Sales = Table.SelectColumns(trndet_Table,{"id_branch", "id_maj_grp_prod","cost_line","sell_line","date_invoiced"}),
Sales2=Table.SelectRows(Sales, each [date_invoiced] > #date(2018, 5, 1))
in
Sales2

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi

 

Thanks , here also it create the Sales table first with all the rows and then it start filtering , so it takes time ,I want to combine the select columns and rows coding in one statement

Hi @Indika156,

 

Please use below query: 

 

let
Source = Odbc.DataSource("dsn=stix", [HierarchicalNavigation=true]),
STIX_Database = Source{[Name="STIX",Kind="Database"]}[Data],
PUB_Schema = STIX_Database{[Name="PUB",Kind="Schema"]}[Data],
trndet_Table = PUB_Schema{[Name="trndet",Kind="Table"]}[Data],
Sales2=Table.SelectRows(Table.SelectColumns(trndet_Table,{"id_branch", "id_maj_grp_prod","cost_line","sell_line","date_invoiced"}), each [date_invoiced] > #date(2018, 5, 1))
in
Sales2

 

Best Regards,
Qiuyun Yu 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors