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
Lionelbennaceur
Regular Visitor

Flag order ID lines with specific product combination

Hi,

I have a table with order lines that have duplicated order ID if a order as multiple purchased products. 
i would like to flag order lines that have a certain products (column B) for the same order ID (column A)

Would you be able to help?

thx a bunch!

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

Hello - this is how you can do it.  This example is returning true in the new column "Multi-Line and Contains Diamond" if there is more than one row of the same product category and if the product name contains the word diamond.

 

Table.AddColumn ( #"Changed Type", "Multi-Line and Contains Diamond", let ProductCategory = #"Changed Type"[Product Category] in (x) => Text.Contains ( x[Product], "diamond", Comparer.OrdinalIgnoreCase ) and List.Count ( List.Select ( ProductCategory, each _ = x[Product Category] ) ) > 1, type logical )

 

jennratten_0-1693331810861.png

 

View solution in original post

1 REPLY 1
jennratten
Super User
Super User

Hello - this is how you can do it.  This example is returning true in the new column "Multi-Line and Contains Diamond" if there is more than one row of the same product category and if the product name contains the word diamond.

 

Table.AddColumn ( #"Changed Type", "Multi-Line and Contains Diamond", let ProductCategory = #"Changed Type"[Product Category] in (x) => Text.Contains ( x[Product], "diamond", Comparer.OrdinalIgnoreCase ) and List.Count ( List.Select ( ProductCategory, each _ = x[Product Category] ) ) > 1, type logical )

 

jennratten_0-1693331810861.png

 

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.

Top Solution Authors
Top Kudoed Authors