Dax Function: FIXED

Category: Text Functions

The FIXED function in Power BI is a DAX text function that formats a number as text with a specified number of decimal places. It allows for controlling whether commas are included as thousand separators and ensures the returned result is always a text string.

Purpose

The primary purpose of the FIXED function is to convert numerical values into text while retaining a specific format, including the number of decimals and separators. This is especially useful for presenting numbers in a consistent format in reports, tooltips, or calculated columns.

Type of Calculations

The FIXED function performs rounding, formatting, and text conversion calculations:

  1. Rounds numbers to the specified number of decimal places.
  2. Converts the rounded number to a text string.
  3. Optionally adds or removes thousand separators.

Practical Use Cases

  • Formatting sales or revenue figures for presentation in dashboards.
  • Preparing text-based values for export to other systems requiring specific formats.
  • Combining formatted numbers with text in custom messages or labels.

FIXED(<number>, <decimals>, <no_commas>)</no_commas></decimals></number>

ParameterTypeDescription
numberNumeric/ScalarThe number to format.
decimalsInteger/Scalar(Optional) Number of decimal places to display. Defaults to 2 if not specified.
no_commasBoolean/Scalar(Optional) TRUE to exclude commas as thousand separators; FALSE (default) to include them.

How Does FIXED Dax Function Works

  • The function takes a numerical input and rounds it to the specified number of decimal places.
  • Converts the rounded number into a string while applying the formatting rules (commas and decimal precision).
  • Returns the formatted number as a string.

What Does It Return?

The FIXED function returns a text string representing the formatted number.

When Should We Use It?

  • Displaying formatted numeric values in reports.
  • Preparing text-based exports where numbers must follow a specific format.
  • Labeling visuals or custom tooltips with numeric details formatted as text.

Examples

Basic Usage

Format a number to two decimal places with commas.


FIXED(12345.6789)

Result: "12,345.68"

Column Usage:

Apply the FIXED function to a column of sales data.


FORMAT_Sales = FIXED(Sales[Amount], 0)

Result: A column with sales amounts formatted as whole numbers with commas.

Advanced Usage

Combine FIXED with other text in a calculated column.


"Revenue: " & FIXED(Sales[Amount], 2)

Result: A string such as "Revenue: 12,345.68"

Tips and Tricks

  • Use the FIXED function when precise control over formatting is required. For less strict formatting, consider the FORMAT function.
  • Be cautious about using the FIXED function on large datasets, as converting numbers to text can increase memory usage.
  • Avoid using FIXED for calculations or aggregations since the return value is text.

Performance Impact of FIXED DAX Function:

  • When formatting large datasets, consider performing formatting only at the report level to reduce memory usage.
  • Use FIXED sparingly in calculated columns, as text fields consume more storage than numeric fields.

Related Functions You Might Need

  • FORMAT: Provides more flexibility in formatting numbers and dates.
  • ROUND: Rounds a number to a specified number of decimal places without converting it to text.
  • TEXT: Similar to FIXED but with broader use cases for custom formatting.

Want to Learn More?
For more information, check out the official Microsoft documentation for FIXED You can also experiment with this function in your Power BI reports to explore its capabilities.

Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.

1. What does the FIXED function do in Power BI?

The FIXED function formats numbers as text with specified decimals and optional thousand separators.

2. Is the FIXED function case-sensitive?

No, the FIXED function deals with numeric formatting and is not case-sensitive.

3. Can the FIXED function exclude commas in the output?

Yes, you can exclude commas by setting the no_commas parameter to TRUE.

4. What happens if the decimals parameter is omitted?

The function defaults to displaying two decimal places.

5. Is the FIXED function suitable for numeric calculations?

No, since it converts numbers to text, it should not be used for calculations.