cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Analyst001
Frequent Visitor

removing items by adding a conditional line in the query

Hi There....I want to remove items from a column by adding a condition in the query....please help me how do I proceed

1 ACCEPTED SOLUTION
mahoneypat
Super User IV
Super User IV

You can add a filter steps using any of your current values and then modify using the pattern below.

 

= Table.SelectRows(#"Previous Step", each List.Contains({"CurrentItem", "FutureItem"}, [ColumnToFilter]) = false)

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

4 REPLIES 4
Ailsa-msft
Community Support
Community Support

Hi @Analyst001 

Your needs are not very clear, maybe you can provide some data or the results you want ?

I created a sample , you can refer to it

Original data:

Ailsa-msft_0-1620869043833.png

I want to remove the content of 2 from the content of 1 .

And add a custom column .

Ailsa-msft_1-1620869043836.png

Result=Text.Combine(List.RemoveItems(Text.Split([Column1],","),Text.Split([Column2],",")),",")

The effect is as shown:

Ailsa-msft_2-1620869043837.png

 

Best Regards

Community Support Team _ Ailsa Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mahoneypat
Super User IV
Super User IV

You can add a filter steps using any of your current values and then modify using the pattern below.

 

= Table.SelectRows(#"Previous Step", each List.Contains({"CurrentItem", "FutureItem"}, [ColumnToFilter]) = false)

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Portrek
Resolver II
Resolver II

You can just put filter in your columns e select the itens that you want or need. After the selection, load the table.

I cannot use filters as one item is from the list and one is coming in the future

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors