VALUE

VALUE

How to Use the Power BI DAX function VALUE

Syntax of the VALUE Function

The syntax of the VALUE function in Power BI is as follows:


VALUE(❰text❱)


Here, `❰text❱` refers to the cell or field that needs to be converted into a numerical value.

Examples of Using the VALUE Function

Let's take a look at some examples of how the VALUE function can be used in Power BI.

Example 1: Converting Text to Numerical Values

Suppose we have a table with the following data:

| Item | Price |

|------|-------|

| A | $10 |

| B | $20 |

| C | $30 |

Here, the `Price` column contains text values that represent currency values. To convert these values into numerical values, we can use the following formula:


=VALUE(SUBSTITUTE([Price],”$”,””))


This formula replaces the `$` symbol with an empty space, and then applies the VALUE function to convert the text to a numerical value.

Example 2: Handling Errors

In some cases, the text values may not be in the correct format, which can lead to errors when applying the VALUE function. To handle such errors, we can use the IFERROR function, as shown below:


=IFERROR(VALUE([Text]),0)


This formula first applies the VALUE function to the `Text` field. If an error is encountered, it returns a default value of `0`.

Example 3: Converting Dates to Numerical Values

The VALUE function can also be used to convert dates into numerical values. For example, consider the following data:

| Date | Sales |

|------------|-------|

| 01/01/2021 | $100 |

| 02/01/2021 | $200 |

| 03/01/2021 | $300 |

Here, the `Date` column contains date values in the format `DD/MM/YYYY`. To convert these values into numerical values, we can use the following formula:


=VALUE(TEXT([Date],”YYYYMMDD”))


This formula first uses the TEXT function to convert the date values into a string in the format `YYYYMMDD`, and then applies the VALUE function to convert the string to a numerical value.

The VALUE function in Power BI is a powerful tool that allows users to convert text values into numerical values. It can be particularly useful in situations where data is imported from external sources and the values are not recognized as numbers by default. The syntax of the VALUE function is simple, and it can be used in a variety of scenarios, ranging from converting currency values to numerical values to converting dates to numerical values. With the VALUE function at your disposal, you can easily analyze and report on your data with greater accuracy and precision.

Power BI DAX Training Courses by G Com Solutions (0800 998 9248)

Upcoming Courses

Contact Us

Subject

Your Name (required)

Company/Organisation

Email (required)

Telephone

Training Course(s)

Your Message

Upload Example Document(s) (Zip multiple files)

Copyright, G Com Solutions Ltd, 2024.
Tower Bridge Business Centre, 46-48 East Smithfield, London E1W 1AW
0800 998 9248   |   9:00 a.m. till 5:30 p.m.

Connect With Me: