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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Damiax
Frequent Visitor

Select all rows of a column with Table.SelectRows function in PowerQuery Editor

Hi Everybody,

 

I have recently opened this thread in order to find whether there is the possibility to select every rows of a column, according to multiple conditions.

 

I'll explain here.

Suppose we have this conditions applied:

let
    Origine = Odbc.DataSource("dsn=BBB", [HierarchicalNavigation=true]),
    admin_Database = Origine{[Name="AAA",Kind="Database"]}[Data],
    admin_Schema = admin_Database{[Name="AAA",Kind="Schema"]}[Data],
    View= admin_Schema{[Name="bs_cono_abi",Kind="Table"]}[Data],
    FilteredTable = Table.SelectRows(View, each ([A] = ABI_ALIAS) and ([B] = "someuser") and ([C] = ENV_ABI))
in
    FilteredTable

 

 

Columns A and C are filtered through parameters (and they will be constant over time) ABI_ALIAS and ENV_ABI, and those are ok, while column B should be filtered accepting all the rows contained in it; you could point out the fact that I could easily reach my objective avoiding that column to be inserted in the script, but i am forced to pass all columns, A, B, and C, in order to allow table to be correctly evaluated from PowerBI.

 

So, I would like to know whether there's a proper way to reach this particular target.


Thanks in advance,

Damiano

2 REPLIES 2
amitchandak
Super User
Super User

@Damiax , Based on what I got

. You can use the Table.AddColumn function to create a new column that duplicates the values from column B and then filter it based on your conditions.

 

Power BI- Power Query Table.AddColumn- https://youtu.be/dEDK4wktAME

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak, that's not the solution, I need to filter that column, so I need a condition that specify "Filter column B taking everything in it", a sort of Select All.

 

Is there any script?

 

D

Helpful resources

Announcements