Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Duplicating rows from one table with rows from another table

Dear Power BI Team,

 

I want to produce one table that will allow to duplicate rows of one initial table (table A) with the rows from another table (table B).

In order to give you a clear picture, you will find one example below that describe the requirement : 

 

Table A - Suppliers

Supplier IDSupplier Name
01Microsoft
023M
03Google

 

Table B - Customer relationship

Customer IDCustomer Name
AGeorge
BBrian
CJohnny

 

 

Target Result table :

 

Supplier IDSupplier NameCustomer Name
01MicrosoftGeorge 
023MGeorge
03GoogleGeorge
01MicrosoftBrian
023MBrian
03GoogleBrian
01MicrosoftJohnny
023MJohnny
03GoogleJohnny

 

Will you have any tips/formulas in order to generate such duplication of rows in Power BI using DAX ?

 

Thank you very much in advance for your appreciated help !

  • hi Anonymous 

    you can create a table with this:

    Table =
    CROSSJOIN(
        VALUES(relationship[Customer Name]),
        Suppliers
    )
     
    it worked like this:

3 Replies

  • hi Anonymous 

    you can create a table with this:

    Table =
    CROSSJOIN(
        VALUES(relationship[Customer Name]),
        Suppliers
    )
     
    it worked like this:
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello, 

    you can create a table with DAX

    Table = CROSSJOIN(Suppliers,'Customer relationship')
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi All.

    Brilliant.

     

    Thank you for your very quick solution !!