Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello everyone,
I need to calculate the sum of the values of the items in a Sales Order.
My report works with three tables:
SO code | Item Code |
SO1 | 0002 |
SO2 | 0002 |
SO2 | 0001 |
SO3 | 0004 |
SO4 | 0005 |
SO5 | 0003 |
SO5 | 0001 |
SO5 | 0002 |
IF code | SO code |
IF1 | SO1 |
IF2 | SO1 |
IF3 | SO1 |
IF4 | SO3 |
IF5 | SO5 |
IF6 | SO2 |
IF7 | SO2 |
Item Code | Last Year Cost |
0001 | 4,64 € |
0002 | 4,76 € |
0003 | 2,54 € |
0004 | 4,48 € |
0005 | 5,22 € |
I built a view based on the IF table. It displays the Sales Orders in the IF table and, when drilling-down to the second level, all the IFs related to that SO. I want to display on another column of the same view the sum of the costs of the items contained in the SO in each row.
Thank you very much for your help!
Solved! Go to Solution.
Hi @Anonymous,
You can try to use the following measure formula on your ‘IF’ table visuals to show the correspond sales:
formual =
VAR ItemCodeList =
CALCULATETABLE (
VALUES ( 'Sales Order'[Item Code] ),
FILTER (
ALLSELECTED ( 'Sales Order' ),
[SO Code] IN VALUES ( 'Item Fulfillment'[SO Code] )
)
)
RETURN
CALCULATE (
SUM ( 'Item List'[Last Year Cost] ),
FILTER ( ALLSELECTED ( 'Item List' ), [Item Code] IN ItemCodeList )
)
Regards,
Xiaoxin Sheng
Hi @Anonymous,
You can try to use the following measure formula on your ‘IF’ table visuals to show the correspond sales:
formual =
VAR ItemCodeList =
CALCULATETABLE (
VALUES ( 'Sales Order'[Item Code] ),
FILTER (
ALLSELECTED ( 'Sales Order' ),
[SO Code] IN VALUES ( 'Item Fulfillment'[SO Code] )
)
)
RETURN
CALCULATE (
SUM ( 'Item List'[Last Year Cost] ),
FILTER ( ALLSELECTED ( 'Item List' ), [Item Code] IN ItemCodeList )
)
Regards,
Xiaoxin Sheng
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
11 | |
10 | |
10 | |
9 |
User | Count |
---|---|
18 | |
13 | |
12 | |
11 | |
8 |