Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Power Query Number.Asin: A How-To Guide

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Power Query's Number.Asin function returns the arcsine (inverse sine) of a number, expressed in radians. In plain terms, you give it a sine value between -1 and 1, and it tells you the angle that produces that sine. To use it, you add a custom column or edit an existing step in the Power Query Editor and call Number.Asin with a numeric field or literal. It is a native M function, so it works in Excel, Power BI, and any tool that hosts Power Query — no add-ins or extra permissions are needed.

What You'll Need

  • A version of Excel, Power BI Desktop, or another host that includes the Power Query Editor. The function is part of the standard M library, so no separate install is required.
  • A table or query loaded into Power Query with at least one numeric column containing values between -1 and 1 (inclusive).
  • Basic familiarity with adding a custom column or editing the formula bar. You do not need to write full M code from scratch.

Step-by-Step

  1. Load your data into Power Query. In Excel, select your table and choose Data > From Table/Range. In Power BI Desktop, choose Home > Transform data to open the Power Query Editor. Menu labels can differ slightly by version, device, or region.
  2. Confirm the input column is numeric. Click the column header and check the data type icon in the column header or on the Home tab. If it shows Text or Any, change it to Decimal Number or Whole Number. Number.Asin expects a number; text values will produce errors.
  3. Add a custom column. On the Add Column tab, click Custom Column. In the dialog, give the new column a name such as AsinResult.
  4. Enter the formula. In the formula box, type Number.Asin([YourColumn]), replacing [YourColumn] with the exact name of your numeric column. Column names are case-sensitive and must be enclosed in square brackets. Click OK.
  5. Check the result. The new column should show decimal values. These are angles in radians. For example, an input of 0.5 returns approximately 0.5236 radians, which equals 30 degrees.
  6. Convert to degrees if needed. Multiply the result by 180 and divide by Pi. You can do this in the same custom column formula: Number.Asin([YourColumn]) * 180 / Number.PI. Alternatively, add a second custom column that references the first.
  7. Handle out-of-range values. If any input is less than -1 or greater than 1, the function returns an error. Decide whether to filter those rows out, replace them with null, or wrap the call in try ... otherwise null to keep the query running.
  8. Apply and load. Click Close & Load (Excel) or Close & Apply (Power BI) to send the results back to your worksheet or data model.

Common Mistakes

  • Passing text instead of numbers. If the column data type is Text, Number.Asin returns an error even when the visible characters look like numbers. Fix the type first.
  • Forgetting the square brackets. Writing Number.Asin(YourColumn) instead of Number.Asin([YourColumn]) causes a syntax error because M treats the bare name as an unknown identifier.
  • Assuming the output is in degrees. Number.Asin always returns radians. Many users expect degrees and are surprised by small decimal results.
  • Ignoring out-of-range inputs. Values outside -1 to 1 are mathematically undefined for arcsine. The function errors rather than clamping, so plan for it.
  • Using a column name with spaces without brackets. Column names containing spaces still need square brackets, for example Number.Asin([Sine Value]).

Tips

  • Use Number.PI rather than typing 3.14159 to keep degree conversions precise.
  • Wrap the call in try Number.Asin([Column]) otherwise null when your source data may contain invalid values. This keeps the query from failing on a single bad row.
  • Rename the output column immediately so downstream steps and reports are readable.
  • If you need the inverse cosine or tangent, the same pattern applies with Number.Acos and Number.Atan.
  • Test with a known value first, such as 0.5, to confirm your formula and degree conversion are correct before applying to the full dataset.

Troubleshooting

If the custom column shows Error for every row, check the data type of the input column and confirm the formula references the correct column name. If only some rows error, inspect those values for text, blanks, or numbers outside -1 to 1. If the formula bar reports a syntax error, verify the square brackets and the function name spelling. If the query is slow, the issue is usually elsewhere; Number.Asin itself is lightweight. If results look wrong, confirm you are not double-converting between radians and degrees. If the column disappears after a refresh, check that the source column still exists and has not been renamed.

Frequently Asked Questions

What does Number.Asin return?

It returns the arcsine of a number in radians, for inputs between -1 and 1 inclusive.

Can I get the result in degrees?

Yes. Multiply the result by 180 and divide by Number.PI, either in the same formula or in a follow-up column.

Why does Number.Asin give an error?

The most common causes are a text data type, a missing square bracket around the column name, or an input outside the -1 to 1 range.

Does Number.Asin work in both Excel and Power BI?

Yes. It is part of the shared M library used by the Power Query Editor in both applications.

How do I handle invalid values without breaking the query?

Use try Number.Asin([Column]) otherwise null so invalid rows return null instead of an error.

Is there a degree version of the function?

No. Power Query provides the radian version only; convert manually as described above.