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
alexrf86
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
v-zhenbw-msft
Community Support
Community Support

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
v-zhenbw-msft
Community Support
Community Support

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.

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
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.