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.
Hi,
In my products table, I would like to calculate a total profit for each product, using Qty, and Profit/Qty from sales table.
What will be the syntax?
Must I use RELATED and/or CALCULATE?
Thank you,
Alex
Solved! Go to Solution.
Hi @Sasha,
If you use a table visual, you can directly drag Products[ProductName] and Sales[Qty] into table visual. Choose the sum aggregation for Qty.
If you want to add a calculated column to show total Qty in Product table, please refer to below DAX:
total Qty = CALCULATE(SUM(Sales[Qty]),USERELATIONSHIP(Products[ProductName],Sales[ProductName]))
Best regards,
Yuliana Gu
Hi @Sasha,
If you use a table visual, you can directly drag Products[ProductName] and Sales[Qty] into table visual. Choose the sum aggregation for Qty.
If you want to add a calculated column to show total Qty in Product table, please refer to below DAX:
total Qty = CALCULATE(SUM(Sales[Qty]),USERELATIONSHIP(Products[ProductName],Sales[ProductName]))
Best regards,
Yuliana Gu
i @Sasha, this highly depends on your data model
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Only Sales and Products exist - one to many on the product id.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |