Forum Discussion
Anonymous
8 years agoNot applicable
divide one column by other
Hi All, I am new to power bi and am trying to divide two existing columns and get result into calculated column,but the results are incorrect.can someone please help.I tried to use below ...
Greg_Deckler
Community Champion
8 years agoStrange, are you sure you are creating a calculated column? I did this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCihKzcnMzcxLLKpU8MtPSVXwyU/OVtJRMjc3MARSRqZmhkqxOtFKnnnFBanJJZn5eQrO+bkFOaklqQhVJoZmSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Nodemajormilestonename = _t, Total = _t, completed = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Nodemajormilestonename", type text}, {"Total", Int64.Type}, {"completed", Int64.Type}})
in
#"Changed Type"And created this calculated column in that table and got the right answers:
%Complete = DIVIDE([completed],[Total])