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
ckurir
Frequent Visitor

Int64.From is rounding numbers, not taking just the integer part

I have a problem using Int64.From. I just wants the integer part of a number

If I have the number 4.8 it always give me "5", no matter which RoundingMode I use

Int64.From(4.8,null,Roundingmode.Down) = 5

 

Any idea why and how to work around?

1 ACCEPTED SOLUTION
jennratten
Super User
Super User

Hello!  Please try this:

Number.RoundDown ( 4.8 )

 

jennratten_0-1641482117212.png

 

View solution in original post

4 REPLIES 4
AlexisOlson
Super User
Super User

The rounding mode only determines how to round numbers like 0.5 that need a tie-breaking rule to round up or down.

 

This is the "why" and @jennratten gives a good "work around".

jennratten
Super User
Super User

Hello!  Please try this:

Number.RoundDown ( 4.8 )

 

jennratten_0-1641482117212.png

 

Thanks a lot, 

I am relatively new to power query, but in many other programming languages INT means just taking the integer value, not rounding off. I do not understand why power query both have rounding functions and also use INT for rounding.

It is a bit unusual but one difference is that Int64.From can take text as input as well whereas Number.RoundDown("4.8") will throw an error.

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.