Forum Discussion
ggfd
2 years agoNew Member
Adding a new column from another with specific cell values
Hello group, I have a spreadsheet column with incorrect values. However, there's no "one size fits all". In other words, I cannot apply a reduction of 25% to the entire column, as some cells are cor...
- Anonymous2 years ago
Hi ggfd ,
You can achieve this in DAX easily if your data can be transformed into this:The data types of all columns except the first are Decimal number.
You can use these DAXs to create two new columns:Fixed Expected Revenue 2023 = 'Table'[Expected Revenue 2023 (PowerBI column Type: decimal number)] * (1 - 'Table'[TASD1200])Fixed Expected Revenue 2024 = 'Table'[Expected Revenue 2024 (PowerBI column Type: decimal number)] * (1 - 'Table'[TASD1200])The final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
2 years agoNot applicable
Hi ggfd ,
Please try this:
Here is my sample data:
Use this DAX to create a new column:
Fixed Value =
SWITCH(
TRUE(),
'Table'[Product] = "B", 'Table'[Old Value] * 0.8,
'Table'[Product] = "C" || 'Table'[Product] = "D", 'Table'[Old Value] * 0.65,
'Table'[Old Value]
)
The final output is below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.