Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

how to convert "K" to thousands?

I have a column with numbers and some of the rows contain "K" value next to the number. for example: 23.5K.

I want to convert the number to be 235000 instead. please help.

lamlam12_0-1634282591160.png

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try this in a new custom column:

 

if Text.EndsWith(Text.From([Expenses]), "K")
then Number.From(Text.Start([Expenses], Text.Length([Expenses]) - 1)) * 1000
else [Expenses]

 

 

If you want to do this transformation in-column, rather than creating a new one, you could add a replace values custom step instead, something like this:

Table.ReplaceValue(
  previousStep,
  each [Expenses],
  each if Text.EndsWith(Text.From([Expenses]), "K")
  then Number.From(Text.Start([Expenses], Text.Length([Expenses]) - 1)) * 1000
  else [Expenses],
  Replacer.ReplaceValue,
  {"Expenses"}
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrE0tjDRMzJWitWJVjI21bNU8AYzDc31DIyylWJjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Exp = _t]),
    #"To Num" = Table.AddColumn(Source, "Num", each if Text.Contains([Exp], "k", Comparer.OrdinalIgnoreCase) then Expression.Evaluate(Text.Select([Exp], {"0".."9","."}) & "*1000") else Number.From([Exp]))
in
    #"To Num"

Screenshot 2021-10-15 212912.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

Try this in a new custom column:

 

if Text.EndsWith(Text.From([Expenses]), "K")
then Number.From(Text.Start([Expenses], Text.Length([Expenses]) - 1)) * 1000
else [Expenses]

 

 

If you want to do this transformation in-column, rather than creating a new one, you could add a replace values custom step instead, something like this:

Table.ReplaceValue(
  previousStep,
  each [Expenses],
  each if Text.EndsWith(Text.From([Expenses]), "K")
  then Number.From(Text.Start([Expenses], Text.Length([Expenses]) - 1)) * 1000
  else [Expenses],
  Replacer.ReplaceValue,
  {"Expenses"}
)

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.