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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
SoftwareTester
New Member

Change Table in a list based on the presence of a specific column

I retrieved values for several series of options from a few webpages with
tblOptionTables = Table.AddColumn(tblPages, "OptionTables" , each Web.Page(Web.Contents([Pages])){0}[Data]),
lis = tblOptionTables[OptionTables]              // a List of Tables  first column being "Calls" if valid otherwise "Column1"

Within tblOptionTables I want to replace each reference to a table (all being different tables of course) by null if it's not a valid table.
A table is valid if it's first column is "Calls".

At best it might be that while generating tblOptionTables null will be added instead of the table {0}[Data] if the table is not valid. 

how can I acchieve what i want?

1 REPLY 1
wdx223_Daniel
Super User
Super User

=List.Transform(lis,each if Table.ColumnNames(_){0}="Calls" then _ else null)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.