The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
Which function should I use to convert text to number in a new column? I want to convert these:-
Chocolate = 1
Candy = 2
Bottled Water = 3
Beer = 4
Thanks!
Solved! Go to Solution.
Hi, @925stuart I hope you've got the idea.
let
Source = #table({"product"}, {{"Chocolate"}, {"Candy"}, {"Bottled Water"}, {"Beer"}}),
rec = [Chocolate = 1, Candy = 2, Bottled Water = 3, Beer = 4],
new_column = Table.AddColumn(Source, "new_column", each Record.FieldOrDefault(rec, [product]))
in
new_column
Cool! That was what I needed to get started! Found the doc!
Hi, @925stuart I hope you've got the idea.
let
Source = #table({"product"}, {{"Chocolate"}, {"Candy"}, {"Bottled Water"}, {"Beer"}}),
rec = [Chocolate = 1, Candy = 2, Bottled Water = 3, Beer = 4],
new_column = Table.AddColumn(Source, "new_column", each Record.FieldOrDefault(rec, [product]))
in
new_column