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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Madhan_
Frequent Visitor

How to Convert column having Text values as Million and Billion to number in Power BI

Hi

I have text values in one column (Funding col), like $2.5M and $4.5B. I want to convert this column into a numerical one like 2,500,000 and 4,500,000,000 for the whole column. so I can calculate further

f45a136c-9594-41de-9d78-845384c0820a.jpg

Please provide solution

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

you can use the following macro

mangaus1111_0-1665399382127.png

 

View solution in original post

4 REPLIES 4
Madhan_
Frequent Visitor

Hello Pal, I'm sorry still its not working.

mangaus1111
Solution Sage
Solution Sage

you can use the following macro

mangaus1111_0-1665399382127.png

 

Yes, I have tried that. Now I am able to calculate. Whereas I am having doubt that will it works fine if more data will be added in the same format like 10M or 2B to the dataset in future.

mangaus1111
Solution Sage
Solution Sage

Hi @Madhan_ ,

 

try this code in Power Query

 

#"Replaced Value" = Table.ReplaceValue(Funding_Table,"M","000000",Replacer.ReplaceText,{"Funding"}),
#"Replaced Value1" = Table.ReplaceValue(#"Replaced Value","B","000000000",Replacer.ReplaceText,{"Funding"}),
#"Changed Type" = Table.TransformColumnTypes(#"Replaced Value1",{{"Funding", type number}})

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.