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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Ritesh_Air
Post Patron
Post Patron

Create a calculate column consist of Prospective Customers for a product

Hi,

 

I am looking for prospects who didn't buy certain products. Like here: I have these customers who bought certain products (A, B, C etc...).

 

 

Ritesh_Air_0-1602616187852.png

 

I am looking for something like this:

Customer 1 is only prospect for Product E,

Customer 2 is prospect for everything except A and C....so on and so forth.

 

I had a solution with measures but client is looking for calculated column so everything in one table. How do I achieve this? I have uploaded the pbix.

 

Ritesh_Air_1-1602616274925.png

 

https://drive.google.com/file/d/16UfeCTNx-8Ak-J2zPGeG80g3QsboBNbM/view?usp=sharing

 

Thanks,

-rk

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Here's a solution that uses Power Query instead.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIEYkMDA6VYHQjfCYiNkPjOaHwXJL4Rmn4jqHpjKN8YTd4Yaj4y3xXGjwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer = _t, Product = _t, CY = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"CY", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Product]), "Product", "CY"),
    #"Replaced Value" = Table.ReplaceValue(#"Pivoted Column",null,0,Replacer.ReplaceValue,{"A","B","C","D","E"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Customer"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] = 0))
in
    #"Filtered Rows"

View solution in original post

v-lionel-msft
Community Support
Community Support

Hi @Ritesh_Air ,

 

Based on @lbendlin ‘s solution, you can  create a calculated column.

v-lionel-msft_0-1603074474623.png

 

Best regards,
Lionel Chen

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

 

 

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Ritesh_Air ,

 

Based on @lbendlin ‘s solution, you can  create a calculated column.

v-lionel-msft_0-1603074474623.png

 

Best regards,
Lionel Chen

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

 

 

lbendlin
Super User
Super User

Here's a solution that uses Power Query instead.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIEYkMDA6VYHQjfCYiNkPjOaHwXJL4Rmn4jqHpjKN8YTd4Yaj4y3xXGjwUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Customer = _t, Product = _t, CY = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"CY", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[Product]), "Product", "CY"),
    #"Replaced Value" = Table.ReplaceValue(#"Pivoted Column",null,0,Replacer.ReplaceValue,{"A","B","C","D","E"}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Replaced Value", {"Customer"}, "Attribute", "Value"),
    #"Filtered Rows" = Table.SelectRows(#"Unpivoted Other Columns", each ([Value] = 0))
in
    #"Filtered Rows"

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.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors