Power Query Problems

How to Use Power Query Binary Functions and Convert Binary Values

Aamir Naveed AkramAamir Naveed Akram Nov 10, 2026 869 views

Question details

The user wants to understand how to use BinaryFormat functions in Power Query to decode binary file content and convert numeric values to binary text.

How to Use Power Query Binary Functions and Convert Binary Values
Product
Excel / Power Query
Device & OS
not provided
Scenario
Decoding binary data from files or converting decimal numbers to binary strings within Power Query.
Observed behavior
Power Query lacks direct equivalents to Excel's native DEC2BIN function, requiring specific decoders for file content and custom functions for number-base conversions.
Before you start

Ensure you have access to the Power Query Editor and understand the difference between reading binary file content (like a loaded CSV) and converting numeric strings into binary format.

Solution 1Recommended

Decode Binary File Content Using Built-in Decoders

Use appropriate Power Query decoders to read binary data returned from file sources like Folder.Contents.

Power Query Binary functions are primarily designed to describe and decode binary data from files, rather than performing mathematical base conversions.

1
Load the file source

Use data source functions like Folder.Contents or File.Contents to load your files into Power Query. The file content will initially appear as a 'Binary' value in the column.

2
Apply the appropriate decoder function

Click the 'Binary' link in the cell, or apply specific decoding functions based on your file type. Use Excel.Workbook for Excel files, Csv.Document for CSV files, or Lines.FromBinary for raw text files.

3
Expand the decoded data

Once the binary content is decoded into a table format, click the expand icon on the column header to view and manipulate your data inside the Power Query Editor.

Decode Binary File Content Using Built-in Decoders
Free Microsoft Office alternative

Try WPS Office for Seamless Spreadsheet Management

If you find complex Power Query functions and custom M scripts overwhelming, WPS Office offers a lightweight, user-friendly, and free alternative for your daily spreadsheet tasks. Easily perform base conversions using built-in spreadsheet functions without needing to write code.

  1. 1. Download and install: Visit the official WPS website to download and install the free WPS Office suite.
  2. 2. Open your spreadsheet: Launch WPS Spreadsheet and open your existing Excel workbooks seamlessly.
  3. 3. Use native functions: Type =DEC2BIN() directly into any cell to perform instant base conversions without complex queries.
Fully compatible with Microsoft Excel (.xlsx, .xls, .csv) formatsUse built-in functions like DEC2BIN directly in cells without custom codingLightweight and fast installationIntuitive interface similar to Microsoft Office
microsoft office alternative - wps office

Frequently Asked Questions

Does Power Query have a DEC2BIN function?

No, Power Query does not have a native equivalent to Excel's DEC2BIN or BIN2DEC functions. To convert decimal numbers to binary text in Power Query, you must write or implement a custom M code function.

How do I read binary files in Power Query?

When loading a file, Power Query represents it as a 'Binary' value. You must use a specific decoder function corresponding to the file type, such as Excel.Workbook for Excel files or Csv.Document for CSV files, to extract the readable contents.

What are BinaryFormat functions used for in Power Query?

BinaryFormat functions are advanced functions designed to read, describe, and decode custom binary data structures from files or API responses, rather than performing simple mathematical number-base conversions.