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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ngct1112
Post Patron
Post Patron

Replace the last digital with "1" if 0

Hi all, may I know if there is any way I could replace the number if the last digit is "0" then replace with 1

using query like this 

 

 

= Table.ReplaceValue(#"Changed Type",each [QTY],
if Text.End(Text.From([Text], "en-HK"), 1) = 0 then 1))

 

 

QTYQTY-modify
25002501
25012501
50005001
50015001
75007501
10001001
50005001

 

Great thanks!

1 ACCEPTED SOLUTION
Vera_33
Resident Rockstar
Resident Rockstar

Hi @ngct1112 

 

Add a custom column

if Text.End(Text.From([QTY]), 1) = "0" then [QTY]+1 else [QTY]

View solution in original post

3 REPLIES 3
ngct1112
Post Patron
Post Patron

@Vera_33 thanks for your help.

I have also try another option which could be applicable

= Table.ReplaceValue(#"Changed Type", each [QTY], each if Text.End(Text.From([QTY]), 1) = "0"  then 
    [QTY]+1 
    else [QTY],Replacer.ReplaceValue,{"QTY"})

Hi @ngct1112 ,

 

If your issue is solved ,could you pls mark the correct replies as answered to close it?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Vera_33
Resident Rockstar
Resident Rockstar

Hi @ngct1112 

 

Add a custom column

if Text.End(Text.From([QTY]), 1) = "0" then [QTY]+1 else [QTY]

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.