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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
kushal258
Regular Visitor

Converting the Data Type

kushal258_0-1688651197944.png

Suppose I have a column in this way and want to convert it to whole number data type to perform certain calculations, then how can it be done?
I did try creating a new column in Power Query by extracting text between delimiter.
I gave start delimiter as $ and end delimiter as B.
However certain values are in millions (M).
Can anyone please help me ?

Thank You

 

1 ACCEPTED SOLUTION

Hi, 

try this 

if [Column1.2] ="M" then Value.Multiply([Column1.1.2],0.001) else [Column1.1.2]

serpiva64_1-1688719891401.png

 

 

serpiva64_0-1688719859131.png

 

View solution in original post

8 REPLIES 8
AlienSx
Super User
Super User

let
    Source = funding_table,
    new_funding = 
        Table.AddColumn(
            Source, "new funding",
            (x) => 
                try Number.From(Text.BetweenDelimiters(x[Funding], "$", "B")) 
                otherwise Number.From(Text.BetweenDelimiters(x[Funding], "$", "M")) / 1000
        )
in
    new_funding

Thanks AlienSx

kushal258
Regular Visitor

Screenshot 2023-07-07 124727.png

From Funding to Funding_New column

Hi, 

try this 

if [Column1.2] ="M" then Value.Multiply([Column1.1.2],0.001) else [Column1.1.2]

serpiva64_1-1688719891401.png

 

 

serpiva64_0-1688719859131.png

 

Thank You Serpivs64. It has worked

serpiva64
Solution Sage
Solution Sage

Hi,

you can split your column by numbers of character two time; the first from the end

serpiva64_0-1688659100763.png

and the sceon from the start to get the currency and the create a conditional column based on N or B to transform your number

 

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

Thank you for your feedback,

I did try that earlier but there is still one problem. There are certain values in Millions ($USD) and other values in Billions ($USD). So I would have to add "0." to values which are in Millions ($USD). 

 

Please make an example of what you want to achieve

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors