FLOOR

How to Use the Power BI DAX function FLOOR

What is the FLOOR function?

The FLOOR function in DAX is used to round a given number down to the nearest specified multiple. It takes two arguments: the number you want to round, and the multiple to round to. For example, if you want to round the number 3.75 down to the nearest whole number, you would use the FLOOR function with a multiple of 1, like this:


=FLOOR(3.75, 1)


The result would be 3.

How to use the FLOOR function in Power BI

Now that we know what the FLOOR function does, let's take a look at how you can use it in Power BI. The FLOOR function can be used in a variety of ways, depending on your data analysis needs.

Rounding down to the nearest whole number

One common use of the FLOOR function is to round numbers down to the nearest whole number. This can be useful when you're working with data that needs to be presented in whole numbers, such as sales or customer counts. To round a number down to the nearest whole number in Power BI, use the FLOOR function with a multiple of 1, like this:


=FLOOR([Number], 1)


Replace "[Number]" with the actual field or column name of the number you want to round down.

Rounding down to the nearest ten, hundred, or thousand

In addition to rounding down to the nearest whole number, you can also use the FLOOR function to round down to the nearest ten, hundred, or thousand. This can be useful when you're working with large numbers and want to make them more manageable. To round a number down to the nearest ten, hundred, or thousand in Power BI, use the FLOOR function with a multiple of 10, 100, or 1000, respectively. For example, to round a number down to the nearest thousand, use the following formula:


=FLOOR([Number], 1000)


Rounding down to the nearest date

The FLOOR function can also be used to round down dates to the nearest specified date. For example, if you have a column of dates and want to group them by week, you can use the FLOOR function to round them down to the nearest Monday (or any other day of the week). To round down dates in Power BI, use the FLOOR function with a multiple of 7 (for weekly rounding) or 30 (for monthly rounding), like this:


=FLOOR([Date], 7)


Replace "[Date]" with the actual field or column name of the date you want to round down.

In conclusion, the FLOOR function in Power BI is a powerful tool for rounding numbers and dates down to the nearest specified multiple. Whether you're working with sales data, customer counts, or dates, the FLOOR function can help you make your data more manageable and easier to analyze. So next time you're working with data in Power BI, give the FLOOR function a try and see how it can enhance your data analysis.

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)