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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
NazaCingolani
New Member

Calculating New Table for Product Combos

So, here is a sample dataset of how my Sales Table is:

Sales Table:

NazaCingolani_0-1680621612973.png

What I need to do, is understand which are the most common "product combinations" based on this table. An example of the "desirable" output table would be something like the below screenshot:

 

Product Combos Table:

NazaCingolani_1-1680621682703.png


Any help will be much appreciated!

 

Thanks!

 

1 ACCEPTED SOLUTION

Ah okay,

 

try this one:

I've highlighted the only change to the calculated column

Column =
CONCATENATEX (
    CALCULATETABLE (
        ADDCOLUMNS('Table (2)',"Product",'Table (2)'[Product Type]),
        ALLEXCEPT ( 'Table (2)', 'Table (2)'[Order ID] )
       
    ),
    [Product Type],
    " & ",
    [Product Type],ASC
)
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

View solution in original post

4 REPLIES 4
DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

try this calculated column:

 

Column =
CONCATENATEX (
    CALCULATETABLE (
        VALUES ( 'Table (2)'[Product Type] ),
        ALLEXCEPT ( 'Table (2)', 'Table (2)'[Order ID] )
    ),
    [Product Type],
    " & ",
    [Product Type], ASC
)
 
original (right) calculated column (left)
 
DOLEARY85_0-1680627658500.png

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Hi! First of all, thanks for your help.

So, I added the calculated column to my "Sales Table", so now I get the concatenate of the products that were part of that order.

Then, I create a table in Power BI adding the new calculated column (AKA Product Combo), and add the OrderID value as a distinct count, and I get the outcome of how many orders had that combo.

The only thing, is that when an Order has more than "1" product as part of the combo, that is not been considered.

Example:

Order Z: 2 x product A + 3 x Product B
Outcome should be A & A & A & B & B, now im only getting A & B.

Is there a way we could implement this consideration based on the Net Quantity from Sales Table?

Ah okay,

 

try this one:

I've highlighted the only change to the calculated column

Column =
CONCATENATEX (
    CALCULATETABLE (
        ADDCOLUMNS('Table (2)',"Product",'Table (2)'[Product Type]),
        ALLEXCEPT ( 'Table (2)', 'Table (2)'[Order ID] )
       
    ),
    [Product Type],
    " & ",
    [Product Type],ASC
)
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Amazing. It worked like a charm!

One final thing. If I would like to exclude a product from this formula, where should the filter be applied/hardcode?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.