Forum Discussion
Anonymous
5 years agoNot applicable
Need to replace cell value with dynamic value
Hi, I need help to create a dynamic table Lets say I have 2 table as below Table1: Table2: What I need: 1. Calculate sum of 2017, 2018, 2019 profit and sum of cost in table2 as belo...
- 5 years ago
Use the DAX function to create an unpivot table. Create one for Profit and a separate table for Cost and then create a relationship using the Product column,
TB_ProfitByYear =
UNION (
SELECTCOLUMNS (
Sheet1,
"Product", Sheet1[Product],
"Year", 2017,
"Profit", Sheet1[2017 Profit]
),
SELECTCOLUMNS (
Sheet1,
"Product", Sheet1[Product],
"Year", 2018,
"Profit", Sheet1[2018 Profit]
),
SELECTCOLUMNS (
Sheet1,
"Product", Sheet1[Product],
"Year", 2019,
"Profit", Sheet1[2019 Profit]
)
)
Ashish_Mathur
5 years agoSuper User
Hi,
You will not be able to solve this problem because there is no product column in Table2.