Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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 id | quantity | number of orders |
3c | 1 | 5 |
3c | 2 | 6 |
3c | 3 | 3 |
r5 | 1 | 4 |
r5 | 2 | 3 |
r5 | 3 | 4 |
b1 | 1 | 2 |
b1 | 2 | 1 |
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 id | component id | units |
3c | 7uu | 2 |
3c | 4aa | 1 |
r5 | r5 | 2 |
b1 | r5 | 1 |
b1 | 7uu | 4 |
My target is to achieve the following table:
product id | component id | quantity | number of orders | units |
3c | 7uu | 1 | 5 | 2 |
3c | 7uu | 2 | 5 | 2 |
3c | 7uu | 3 | 5 | 2 |
3c | 4aa | 1 | 6 | 1 |
3c | 4aa | 2 | 6 | 1 |
3c | 4aa | 3 | 6 | 1 |
r5 | r5 | 1 | 4 | 2 |
r5 | r5 | 2 | 4 | 2 |
r5 | r5 | 3 | 4 | 2 |
b1 | r5 | 1 | 2 | 1 |
b1 | r5 | 2 | 2 | 1 |
b1 | 7uu | 1 | 1 | 4 |
b1 | 7uu | 2 | 1 | 4 |
May anyone help me please?
Solved! Go to Solution.
Hi @Anonymous ,
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].
2. Then we can create a table visual like this,
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.
Hi @Anonymous ,
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].
2. Then we can create a table visual like this,
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
74 | |
62 | |
51 | |
47 |
User | Count |
---|---|
211 | |
83 | |
64 | |
60 | |
56 |