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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Solution Authors
Top Kudoed Authors