Int8.From

Number

Converts a value to an 8-bit signed integer (-128 to 127).

Examples on this page use shared sample tables. View them to understand the input data before reading the examples below.

Syntax

Int8.From(value as any, optional culture as nullable text, optional roundingMode as nullable number) as nullable number

Parameters

NameTypeRequiredDescription
valueanyYesThe value to convert. Accepts number, text, logical, or null.
culturetextNoAn optional culture string for locale-aware parsing of text values.
roundingModenumberNoAn optional rounding mode constant used when truncating fractional values.

Return Value

numberAn 8-bit signed integer in the range -128 to 127.

Remarks

Int8.From converts a value to a signed 8-bit integer, covering the range -128 to 127. This is the signed counterpart to Byte.From (unsigned, 0–255). Values outside the -128 to 127 range raise an error at runtime. Fractional numbers are rounded before conversion; the default rounding mode is round-half-to-even (banker's rounding). Pass RoundingMode.AwayFromZero to get conventional rounding.

This type is rarely used in typical Power Query data transformation because most integer work uses Int32.From or Int64.From. Int8.From is primarily useful when working with compact binary protocols, interfacing with systems that explicitly declare TINYINT SIGNED columns, or building custom connector schemas that must match a source's 8-bit signed integer type.

Text values are parsed as numbers — scientific notation and decimal strings are accepted. Logical true converts to 1, false to 0, and null returns null. If you need to check whether a value is within the valid range before converting, test value >= -128 and value <= 127 first.

Examples

Example 1: Convert a positive integer

Int8.From(100)
Result
Result
1100

Example 2: Convert a negative integer at the lower bound

Int8.From(-128)
Result
Result
1-128

Example 3: Rounding a decimal — default banker's rounding vs. away-from-zero

#table(
    {"Input", "Default (Banker's)", "AwayFromZero"},
    {
        {2.5, Int8.From(2.5), Int8.From(2.5, null, RoundingMode.AwayFromZero)},
        {3.5, Int8.From(3.5), Int8.From(3.5, null, RoundingMode.AwayFromZero)}
    }
)
Result
Input
Default (Banker's)
AwayFromZero
12.5023
23.5044

Compatibility

Power BI Desktop Power BI Service Excel Desktop Excel Online Dataflows Fabric Notebooks