Forum Discussion
Show values on table based on columns from another table
- 9 months ago
This is an efficient solution and works when you can only choose 1 date. If there is a need to select multiple dates then try:
Parts Planned =
CALCULATE(
SUM('TableB'[Parts Planned]),
TREATAS(
VALUES('TableA'[Date]),
'TableB'[Date]
),
TREATAS(
VALUES('TableA'[part number]),
'TableB'[part number]
)
)
Hi limonSerga,
I tested here and worked. Please try from your side and let me know if it worked.
Parts Planned =
LOOKUPVALUE(
TableB[Parts Planned],
TableB[Date], SELECTEDVALUE(TableA[Date]),
TableB[part number], SELECTEDVALUE(TableA[part number])
)
If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.
Your relationship is based on date only. What you actually need is a match on date and Part Number. An easy solution is to concatenate date and part number in both tables (composite key). You can create a calculated column witth
Parts Planned =
LOOKUPVALUE(
'Table B'[Parts Planned],
'Table B'[Date], 'Table A'[Date],
'Table B'[part number], 'Table A'[part number]
)