Skip to main content

Power BI

Needs Votes

FORMAT function to return Decimal Type

Vote (5) Share
Shaun wilkinson's profile image

Shaun wilkinson on 14 Feb 2019 11:30:35

The FORMAT / FIXED function allows you to dynamically set the formatting of a decimal field within the DAX formula itself. So its great if you have variable number of decimals or formats you wish to display values in.

HOWEVER The FORMAT function returns text.
If the function is used to format a Decimal, Text cannot be aggregated, cannot be used for data bars or sorted in the way a decimal would.

Converting the TEXT back to a decimal using VALUE removes the dynamic control over the display and moves formatting reliance back to the Modelling Tab. Any flexibility in the dynamic formatting of the field is removed. Reliance goes back to the "Auto" formatting of decimals which is unreliable and doesn't retain the decimals set in the FORMAT function.

Comments (2)
Shaun wilkinson's profile image Profile Picture

Vishnu on 10 Jul 2020 17:21:46

RE: FORMAT function to return Decimal Type

Much Needed feature, Sometimes values shown on a bar chart should be formatted based on condition.

Shaun wilkinson's profile image Profile Picture

Shaun Wilkinson on 05 Jul 2020 23:41:06

RE: FORMAT function to return Decimal Type

The FORMAT / FIXED function allows you to dynamically set the formatting of a decimal field within the DAX formula itself. So its great if you have variable number of decimals or formats you wish to display values in.

HOWEVER The FORMAT function returns text.
If the function is used to format a Decimal, Text cannot be aggregated, cannot be used for data bars or sorted in the way a decimal would.

Converting the TEXT back to a decimal using VALUE removes the dynamic control over the display and moves formatting reliance back to the Modelling Tab. Any flexibility in the dynamic formatting of the field is removed. Reliance goes back to the "Auto" formatting of decimals which is unreliable and doesn't retain the decimals set in the FORMAT function.