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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
Employee

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
v-yetao1-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
Employee
Employee

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


Portrek
Resolver III
Resolver III

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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