Forum Discussion

abukapsoun's avatar
abukapsoun
Post Patron
5 years ago
Solved

Multiplying values

Hi, Need your support please. I have the following Table   Reference P01 P02 X -1000 500 Y 800 -600                 How can i transform the sign of values based on ...
  • darentengmfs's avatar
    darentengmfs
    5 years ago

    Hi abukapsoun 

     

    There are 2 ways to do this.

     

    1. You can unpivot the columns, then create the new column with the IF function in DAX
    2. Or, you can create the IF function in Power Query Editor before unpivoting: Power Query > Add Column > Custom Column > Formula: if [Reference] = "X" then [P01]*-1 else [P01]

     

     

    **Update: formula amended as needed