Forum Discussion
Anonymous
5 years agoNot applicable
M Query Divide
dd Hello - I have a column coming in from our ERP system that does not properly place the decimal point. So instead of .5496 the column comes in as a text field and says 54.96. Upon c...
- 5 years ago
Anonymous ,
Guess you got a little confused.
The M-Query should be as follows
= Table.AddColumn(#"Uppercased Text3", "Margin%", each [Margin]/ 100))
where #"Uppercased Text3" is the previous step
Margin% is the new column name
[Margin] is the column that you are going to divide
Ashish_Mathur
5 years agoSuper User
Hi,
This M code works
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Number", type number}}),
#"Inserted Division" = Table.AddColumn(#"Changed Type", "Division", each [Number] / 100, type number)
in
#"Inserted Division"
Hope this helps.
- Anonymous5 years agoNot applicable
Ashish_Mathur That was fast! I have no doubt this works, but I am total novice with m query. I was just thinking a simple custom column would suffice for this. How would I incorporate this into a custom column?
- Ashish_Mathur5 years agoSuper User
Hi,
Try this calculated column formula
=divide(Data[Amount],100)