Forum Discussion

sharpedogs's avatar
sharpedogs
Advocate II
6 years ago
Solved

Calculated Column maybe?

I am looking to create a new column based on two other columns. One of the data fields I am getting is incorrect so I need to correct it.

 

I have 6 different ISP ID's, and I want the new column to say

(If ISP ID = 123.456.556 Then Multiple the (Output) column by 1,000)

(If ISP ID = 123.556.789 Then just carry over the OutPut column) 

 

ISP ID (Text)Output (Number)End Result...
123.456.556 0.987 987
223.556.7671.231,230
123.556.7891.351.35

 

 

  • Anonymous's avatar
    Anonymous
    6 years ago
    Calculated column=switch(true(),table[id]="value1",table[output]*1000,table[output])

    You can added multiple conditions as well by placing comma after 1000 and new condition and new output for condition...follow switch dax syntax.

    But my recommendation is create Calculated column in power query for better performance with large datasets.

    Thanks
    Pravin

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable
    Calculated column=switch(true(),table[id]="value1",table[output]*1000,table[output])

    You can added multiple conditions as well by placing comma after 1000 and new condition and new output for condition...follow switch dax syntax.

    But my recommendation is create Calculated column in power query for better performance with large datasets.

    Thanks
    Pravin