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.
Good evening everyone
I have a question regarding SUMX. I have sales data that contain the Quantity of Sales in the Sales Table and the net price of items in the Dimension Product table. I want to calculate the total price, which is the Quantity*Net Price. Both table already related through ProductID
How to do that?
Thank you
Solved! Go to Solution.
Hi,
In the Sales Table, you may write a calculated column formula (RELAED() function) to bring over the price from the Price table.
Net price = related(Prices[Price])
In the Sales tab, you may write another calculated column formula to calculated the Revenue
Rev = Sales[Net price]*Sales[Quantity]
Now write a measure called Revenue and drag that to your visual
Revenue = sum(Sales[Rev])
Hope this helps.
Hi,
In the Sales Table, you may write a calculated column formula (RELAED() function) to bring over the price from the Price table.
Net price = related(Prices[Price])
In the Sales tab, you may write another calculated column formula to calculated the Revenue
Rev = Sales[Net price]*Sales[Quantity]
Now write a measure called Revenue and drag that to your visual
Revenue = sum(Sales[Rev])
Hope this helps.
Unfortunately, the Net Price calculated column result using RELATED is the sum of price, not price of a single item
Cannot be. RELATED() does not add. It's like the VLOOKUP() of MS Excel.
Sorry my bad, Your solution works just fine. Thank you
You are welcome.
Hi @Anonymous try something like this...
SUMX(
[Sales],
Quantity * RELATED(Product[Price])
)
Without seeing your data model, I doubt the table and field names are correct, but the pattern should work. Hope this helps! 🙂
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |