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.
Hi!
I need to summarize the value of all orders containing an item.
I made a simple model as an example
For example the total order value for ItemA (1) i want to be 1025. Because ItemA is contained i Order 1 and 2 (600 + 425).
I cant get my head around how to write the DAX formula. I need to keep the item filter to get the orderid but at the same time need to get all the orderId's including the ones that the Item relation has filtered.
Please advice 🙂
Solved! Go to Solution.
Hi @Anonymous,
Create a calculated column in 'Orders' table.
Sales per order = CALCULATE ( SUM ( Orders[Sales] ), ALLEXCEPT ( Orders, Orders[OrderId] ) )
Create a measure based on 'Item' table.
sales per item = CALCULATE ( SUM ( Orders[Sales per order] ), ALLEXCEPT ( 'Item', 'Item'[ItemName] ) )
Then, you can add 'Item'[ItemName], 'Item'[Sales] and above measure [sales per item] into table visual.
Best regards,
Yuliana Gu
Hi @Anonymous,
Create a calculated column in 'Orders' table.
Sales per order = CALCULATE ( SUM ( Orders[Sales] ), ALLEXCEPT ( Orders, Orders[OrderId] ) )
Create a measure based on 'Item' table.
sales per item = CALCULATE ( SUM ( Orders[Sales per order] ), ALLEXCEPT ( 'Item', 'Item'[ItemName] ) )
Then, you can add 'Item'[ItemName], 'Item'[Sales] and above measure [sales per item] into table visual.
Best regards,
Yuliana Gu
Thanks @v-yulgu-msft
This also did the trick:
SalesTotalOrder = CALCULATE(SUM(Orders[Sales]);ALL(Orders);VALUES(Orders[OrderId]))
I will try your measures out.
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 |
---|---|
72 | |
70 | |
55 | |
37 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |