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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
monojchakrab
Resolver III
Resolver III

Select column names from a list of column headers

Hello Good people,

 

This possible is a simple solution....

 

  • I have a list of all column headers as follows as a part of a step within a query :

monojchakrab_0-1667066666380.png

  • I will feed this list into another step but I dont want to carry all the columns. So I created another list for the column headers which I want to keep from the list above :

monojchakrab_1-1667066774430.png

  • I have tried to write a code as below :

List.Select(
FirstList,
(_)=> List.ContainsAll(FirstList,SecondList)
)

But this is giving an error....is there some other way to do this or is this code writted wrong and the syntax can be modified?

Any help much appreciated

Best regds.,

1 REPLY 1
Fowmy
Super User
Super User

@monojchakrab 

You can use List.Intersect function
List.Intersect( {FirstList,SecondList} )

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors