Forum

Square Root Formula...
 
Notifications
Clear all

Square Root Formula in Power Query

3 Posts
2 Users
0 Reactions
102 Views
(@apay77)
Posts: 15
Eminent Member
Topic starter
 

I'm trying to add a new column that finds the sqrt of column a^2 + column b^2.  In excel the formula is =SQRT(A1^2+B1^2).

I'm in the Add Custom Column section of PQ and have tried the following formula which is obviously wrong but I can't seem to figure out how to write it.

New Column Name = Volt Amps (VA)

Custom Formula =Table.AddColumn(#"Renamed Energy Positive Wh to kWh","Volt Amps (VA)", each Number.Sqrt([#"Power (W)"]^2)+([#"Energy Reactive (VArs)"]^2)).

Thanks for your help!

Regards,

Anita

 
Posted : 16/10/2022 6:24 am
Riny van Eekelen
(@riny)
Posts: 1194
Member Moderator
 

That generic form would look like this:

= Table.AddColumn( Source, "Custom", each Number.Sqrt ( Number.Power([A],2) + Number.Power(,2) ) )

I trust you can "translate" this into your own table.

 
Posted : 16/10/2022 6:35 am
(@apay77)
Posts: 15
Eminent Member
Topic starter
 

Thank you Riny.

This worked perfectly 🙂

 
Posted : 16/10/2022 8:09 pm
Share: