SQRT

How to Use the Power BI DAX function SQRT

Syntax of the SQRT function

The syntax of the SQRT function in DAX is as follows:


SQRT(number)


The **number** argument is the value for which you want to find the square root. This argument can be a column, a numeric expression, or a scalar value.

Example of using the SQRT function

Let's say you have a table in Power BI that contains the sales data for a company. You want to create a new column in this table that calculates the square root of the sales amount. Here's how you can do it:

1. Open the Power BI Desktop application and load the sales data table.

2. Click on the "Modeling" tab in the ribbon menu and select "New Column".

3. In the formula bar, type the following formula:


Square Root Sales = SQRT(Sales[Amount])


4. Press the Enter key to apply the formula.

5. Power BI will create a new column in the table with the name "Square Root Sales" that contains the square root of the sales amount for each row.

Using the SQRT function with other DAX functions

The SQRT function can be used in combination with other DAX functions to perform more complex calculations. For example, you can use the SQRT function along with the SUMX function to calculate the square root of the sum of all sales amounts. Here's how you can do it:

1. Open the Power BI Desktop application and load the sales data table.

2. Click on the "Modeling" tab in the ribbon menu and select "New Measure".

3. In the formula bar, type the following formula:


Square Root Total Sales = SQRT(SUMX(Sales, Sales[Amount]))


4. Press the Enter key to apply the formula.

5. Power BI will create a new measure with the name "Square Root Total Sales" that contains the square root of the sum of all sales amounts.

The SQRT function is a powerful tool in the Power BI DAX language that allows you to calculate the square root of a given number. In this article, we explored the syntax of the SQRT function and how to use it in Power BI to create new columns and measures. We also showed how the SQRT function can be used in combination with other DAX functions to perform more complex calculations. By using the SQRT function, you can gain deeper insights into your data and make more informed decisions.

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

Upcoming Courses

11-13 November 2024

Contact Us

    Subject

    Your Name (required)

    Company/Organisation

    Email (required)

    Telephone

    Training Course(s)

    Your Message

    Upload Example Document(s) (Zip multiple files)