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,
How can I calculate total cost based on two tables below?
Table 1 (left one) does not have quantity, each row counts as 1 unit.
Referencing Table 2 listing unit cost against product, I would like to calculate total cost in Table 1.
If there was Qty column in Table 1, I would have used below
Solved! Go to Solution.
@Anonymous
Not clear but I assume your default QTY is one.
CALCULATE (
SUMX (
'Table1',
1
* LOOKUPVALUE ( Table2[Unit cost], Table2[Product], Table1[Product] )
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Do you have relationships created between the two tables? Could merge the two tables...
@Anonymous
Not clear but I assume your default QTY is one.
CALCULATE (
SUMX (
'Table1',
1
* LOOKUPVALUE ( Table2[Unit cost], Table2[Product], Table1[Product] )
)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
10 | |
8 |