cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

how to get a tabular table

Hello! I have an issue joining two tables created by DAX. I tried different functions but none gave me the correct result and I am stuck right now...

 

My first table represents the product sales grouped by how many units customers used to purchase in the same shopping cart. For instance, 5 orders bought just one unit of product 3c in the same purchase:

 

product idquantitynumber of orders
3c15
3c26
3c33
r514
r523
r534
b112
b121

 

My second  table represents all components of a product. For instance, product 3c is composed of 2 components: 2 units of 7uu and 1 unit of 4aa:

 

product idcomponent idunits
3c7uu2
3c4aa1
r5r52
b1r51
b17uu4

 

My target is to achieve the following table:

 

product idcomponent idquantitynumber of ordersunits
3c7uu152
3c7uu252
3c7uu352
3c4aa161
3c4aa261
3c4aa361
r5r5142
r5r5242
r5r5342
b1r5121
b1r5221
b17uu114
b17uu214

 

May anyone help me please?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: how to get a tabular table

Hi @alexrf86 ,

 

We are a little confused about your desire table. Why the “3c” ’s number of orders is 5 and 6? Could you please tell us the logic of calculation?

 

If the “3c” ‘s number of orders is 5, 6 and 3,  you can refer the following ways.

 

1. Create a both relationship between table 1 and table 2 based on [product id].

 

H 1.jpg

 

2. Then we can create a table visual like this,

 

H 2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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
Highlighted
Microsoft
Microsoft

Re: how to get a tabular table

Hi @alexrf86 ,

 

We are a little confused about your desire table. Why the “3c” ’s number of orders is 5 and 6? Could you please tell us the logic of calculation?

 

If the “3c” ‘s number of orders is 5, 6 and 3,  you can refer the following ways.

 

1. Create a both relationship between table 1 and table 2 based on [product id].

 

H 1.jpg

 

2. Then we can create a table visual like this,

 

H 2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

Highlighted
Helper III
Helper III

Re: how to get a tabular table

Yes, you are right, my desire table is missing 3 Quantity for 3c product.

 

Your solution is also correct!

 

Thanks a million

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors