Forum Discussion
Need to replace cell value with dynamic value
- 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]
)
)
Anonymous , In the first table, you can unpivot the three profit year column and then split them.
https://radacad.com/pivot-and-unpivot-with-power-bi
https://www.tutorialgateway.org/how-to-split-columns-in-power-bi/
Then create a common year column and join to both tables
- Anonymous5 years agoNot applicable
thanks fo reply
I'm not sure i understand what you mean. Could you explain more to me ?
here is the link of the report
https://drive.google.com/file/d/1vLQ-R4iOiYZC8rbGat_kM4zKRhQ68Phi/view?usp=sharing
I would really appreciate if you can show me how to do that