Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi there,
I have a table relation like below:
1. Location (Loc Code)
2. Item (Item Code)
3. Shipment Planning (Planning No, Loc Code, Item Code, Quantity)
4. Order Lines (Order No, Item Code, Loc Code)
My goal is to show total "Quantity" from "Shipment Planning" for each "Order Line" with the same Item and Location.
Kindly please help 😊
Thanks.
Sample Data
Location (A & B)
Item (X1 & X2)
Shipment Planning
Shipment Planning No | Item | Location | Quantity |
SP#01 | X1 | A | 10 |
SP#02 | X2 | A | 20 |
SP#03 | X1 | B | 30 |
SP#04 | X1 | A | 17 |
Order Lines
Order No | Item | Location | Total Shipment Planning |
SO#01 | X1 | A | 27 |
SO#02 | X2 | A | 20 |
SO#03 | X1 | A | 27 |
SO#04 | X1 | B | 30 |
Solved! Go to Solution.
Download this exampl PBIX solution from Onedrive
Please click thumbs up for the suggestion,
and click [accept solution] if it works.
Your question is a bit vague, always provide an example desired output to clarify what is required.
Download this exampl PBIX solution from Onedrive
Please click thumbs up for the suggestion,
and click [accept solution] if it works.
Your question is a bit vague, always provide an example desired output to clarify what is required.
Hi @speedramps I have see your given example file, and found that the key to get correct result is the selection of "Item No."
Previously, I show "Item No." in my visual from my "Order Lines" table, but after I change the source table for "Item No." from Item table, the total is correct automatically.
Thanks for your help 😊
@Olwin thank you.
Yes you understand correctly.
That is why I provide a diagram of the relationships and highlighted in red which fields you needed to select from which tables to use those relationships correctly.
For me the joy cones from not just giving a solution but teaching the method.
Well done on learning it!
Hi @Olwin ,
To achieve your goal, you need to create a measure to look like this:
TotalShipmentPlanning =
CALCULATE(
SUM('Shipment Planning'[Quantity]),
FILTER(
'Shipment Planning',
'Shipment Planning'[Item] = SELECTEDVALUE('Order Lines'[Item]) &&
'Shipment Planning'[Location] = SELECTEDVALUE('Order Lines'[Location])
)
)
Expected Output:
Please see attached file
@Olwin BTW, here is the output of the solution.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Olwin see the attached solution, in nutshell, you need the following two measures:
Planning Qty = SUM ( ShipmentPlanning[Quantity] )
Total Shipment Planning =
SUMX (
SUMMARIZE (
OrderLines,
'Item'[Items],
Location[Location],
"@Planning Qty", [Planning Qty]
),
[@Planning Qty]
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
124 | |
111 | |
73 | |
65 | |
46 |