Round Time to the Nearest Quarter Hour in Power BI
Round Time to the Nearest Quarter Hour in Power BI, rounding time to the nearest quarter hour can be crucial for various applications, including reporting and data aggregation.
By using DAX (Data Analysis Expressions) in Power BI, you can easily create new columns that adjust time values to the nearest 15 minutes.
Round Time to the Nearest Quarter Hour
This article will guide you through the process step-by-step.
Rounding Time with DAX in Power BI
To round time to the nearest quarter hour, you can use the following DAX syntax:
Rounded Time = MROUND('my_data'[Datetime], TIME(0, 15, 0)) + TIME(0, 0, 0)
This formula generates a new column named Rounded Time
in your table (here referred to as my_data
) that rounds the time in the Datetime
column to the nearest quarter hour.
Example in Action
Imagine you have a table in Power BI called my_data
, which records total sales transactions along with their corresponding timestamps.
Step 1: Access Your Data
- Open Power BI Desktop: If you haven’t already, launch Power BI and open your project that contains the
my_data
table. - Select Your Table: Click on the
Data
tab to view your table data.
Step 2: Create a New Column for Rounded Time
- Navigate to Table Tools: Click on the Table tools tab in the Ribbon.
- Add a New Column: Click on the New column button to start creating a new column.

Step 3: Enter the DAX Formula
In the formula bar, input the following DAX expression:
Rounded Time = MROUND('my_data'[Datetime], TIME(0, 15, 0)) + TIME(0, 0, 0)
Step 4: Review Your Results
After entering the formula, the Rounded Time
column will be automatically populated. Here’s how the rounding works with some examples:
- 10:15:00 AM stays 10:15:00 AM (no change needed).
- 7:15:23 PM rounds down to 7:15:00 PM.
- 1:15:09 AM rounds down to 1:15:00 AM.
- 8:49:03 PM rounds down to 8:45:00 PM.
Understanding the Formula
Let’s break down how this formula functions:
- MROUND Function: The
MROUND
function takes two arguments: the number to round and the multiple to which you want to round. In this case, it rounds the time inDatetime
to the nearest 15 minutes (a quarter hour). - TIME Function: The addition of
TIME(0, 0, 0)
does not change the rounded result but ensures the output is formatted as a time value rather than a numeric representation.
Conclusion
Rounding time to the nearest quarter hour in Power BI is a straightforward process with DAX. By following the steps outlined in this article, you can create a new column that helps streamline your analysis and reporting.
This functionality is particularly useful in sales, finance, and any other domains where time-based data plays an essential role in decision-making.
Utilizing DAX to enhance your data representation in Power BI allows for more precise analytics, enabling you to derive actionable insights from your data.
Start using this technique in your reports today to improve the way you handle time data!