Power BI Date Formatting

What is Date Format in Power BI?

Date Format in Power BI refers to displaying and formatting dates within your reports and visuals. It defines how dates are presented to users, including the arrangement of day, month, and year, the use of separators, and whether to include time information. Proper date formatting enhances the readability and user-friendliness of your reports.

Key Takeaways
  • The date format in Power BI determines how dates are presented in reports and visuals.
  • You can change Power BI date formatting in table in Power Query or Data Model, Power BI date formatting in visual in Power BI Desktop, or visual level (for specific visuals).
  • Custom date formatting can be applied using DAX expressions for more flexibility.
  • Ensure that the data type of the date column is correctly recognized as a date to apply formatting effectively.
  • Keep time zone considerations in mind when working with date and time data.
  • Refresh your data after making date format changes to see the updated formatting in your reports.

How to Change Date Formatting in Power BI?

You can change date formatting in Power BI by following one of these highlighted steps:

Step 1: Import the dataset to Power BI Desktop and load the dataset using the Get data option in the Home tab.

Change - Step 1

Step 2: Navigate to the Fields pane once the dataset is loaded. Select the table, right-click on the table, and choose Edit Query from the menu.

Change - Step 2

It will open a Power Query Editor window.

Power BI Date Formatting - Change - Step 2 - Power query

Step 3: Select the date column you want to format.

Change - Step 3

Step 4: Navigate to the Home tab and choose Data Type as Date/Time.

Power BI Date Formatting - Change - Step 4

It would display a pop-up window to confirm the Change Column Type.

Power BI Date Formatting - Change - Step 4 - conform column type

Step 5: Select the Replace current option. You will notice the date format has changed to Date/Time data type.

Power BI Date Formatting - Change - Step 5

Step 6: Click the Close and Apply option under the Home tab to save the changes and return to the Power BI Desktop screen.

Power BI Date Formatting - Change - Step 6

Now, navigate to the Fields pane and select the table visual that contains the date column. Navigate to the Column tools tab and choose Format.

Power BI Date Formatting - Change - Step 6 - Table Visual

Step 7: Click on the dropdown next to the Format option. You will see the various Date formats supported in Power BI Desktop.

Power BI Date Formatting - Change - Step 7

Step 8: Choose any Date formats from the Format dropdown menu.

Power BI Date Formatting - Change - Step 8

Step 9: Navigate to Table view on the left navigation menu in Power BI Desktop. You will notice the format of the Date field has now changed to the chosen format.

Power BI Date Formatting - Change - Step 9
  • Custom Formatting

You can apply custom date formatting using DAX (Data Analysis Expressions) expressions in calculated columns or measures.

To apply custom formatting, follow the steps highlighted below:

Step 1: Navigate to the Fields pane. Select the table, right-click on the table to open the menu bar, and choose the New measure or New column option.

Power BI Date Formatting - Custom - Step 2

Step 2: Use the FORMAT function to enter the DAX expression in the formula bar. It would enable you to apply any customized date format to the data field you want to change date formatting.

Power BI Date Formatting - Custom - Step 2 - Format

FORMAT (Value, Format, [LocaleName])

  • Value – Refers to the value or expression that’s evaluated
  • Format – A string with formatting template
  • LocaleName – Name of locale
Power BI Date Formatting - Custom - Step 2 - dateformat

Step 3: Click on the Commit icon to save the changes.

Step 4: Navigate to Table view on the left navigation menu in Power BI Desktop. You will notice the format of the Date field has now changed to the chosen format.

Power BI Date Formatting - Custom - Step 4

The next section will see how to change date formatting in Power BI through different examples.

Examples

In this section, we will demonstrate how to change Power BI date formatting in table and Power BI date formatting in visual in a step-by-step process with examples.

Example #1

In this example, we will change Power BI date formatting in a table to create additional columns in PowerQuery Editor using the Uber Request DataUber Request Data dataset contains the details of cabs booked, such as pickup point, driver details, status, request, and drop date with the timestamp.

To change Power BI date formatting in table, follow the steps highlighted below:

Step 1: Open the Power BI Desktop and import the Uber Request Data dataset using the Get Data option. Once you click on Get data, the system will prompt a pop-up window to choose the file. Select the file and click on the Open button to import the dataset.

Example 1 - Step 1

Step 2: Once the data is imported, click on the Load button to load the dataset to Power BI Desktop.

Example 1 - Step 2

Once the data is loaded, you can view it by navigating to the Fields pane.

Example 1 - Step 2 - Data

Step 3:

  • Navigate to the Fields pane.
  • Right-click on the table.
  • Choose the Edit Query option.
Power BI Date Formatting - Example 1 - Step 3

It will open a PowerQuery Editor window with a table dataset.

Power BI Date Formatting - Example 1 - Step 3 - Powerquery.jpg

You can also view the various in-built data types supported in PowerQuery Editor for date and time fields.

Power BI Date Formatting - Example 1 - Step 3

Step 4: Navigate to the Add Column tab, select the column you want to use to create a new column, and then choose the option from the Date menu.

Here we want to create a new column from the Request timestamp. We have selected the Date Only option to create a date field.

Power BI Date Formatting - Example 1 - Step 4

Rename the newly created column to a meaningful description by right-clicking on the newly created column. Here we have renamed the new column to Request Date.

Power BI Date Formatting - Example 1 - Step 4 - Rename

Step 5: Select the column and choose an option from the Time menu. It will create a new column with Time details.

Power BI Date Formatting - Example 1 - Step 5

Rename the column to a meaningful name by choosing the Rename option when you right-click on the new column. Here we have renamed the new column to Request Time.

Power BI Date Formatting - Example 1 - Step 5 - Time

Step 6: Repeat Steps 4 and 5 above to create additional columns based on the Drop timestamp column. Here, we have created two columns, i.e., Drop Date and Drop Time.

Power BI Date Formatting - Example 1 - Step 6

Step 7: Navigate to the Home tab and choose the Close & Apply option to save the changes.

Power BI Date Formatting - Example 1 - Step 7

Once the changes are saved, the PowerQuery Editor will be closed and you will be navigated to the Power BI Desktop.

Step 8: Navigate to the Fields pane to view the new columns.

Power BI Date Formatting - Example 1 - Step 8

You can also view the data for the new columns by navigating to the Table view on the left navigation menu.

Power BI Date Formatting - Example 1 - Step 8 - TableView

Example #2

In this example, we will apply Power BI date formatting in visual to change the date formatting for the existing date field using the INDEX_US_S&P US_SPX. INDEX_US_S&P US_SPX dataset contains S&P price fluctuations such as Open, Close, Low, High, and Daily returns data.

To change Power BI date formatting in the table, follow the steps highlighted below:

Step 1:

  • Open the Power BI Desktop.
  • Import the INDEX_US_S&P US_SPX dataset using the Get Data option.
  • Click on the Load button.
Example 1 - Step 8 - TableView

Once the data is loaded, you can view it by navigating to the Fields pane.

Example 2 - Step 1 - Data

Step 2: Select the column you want to change date formatting. It would enable two additional tabs, i.e., Table tools and Column tools. You will notice Date-related headers such as Data type and Format option under Column tools.

Example 2 - Step 2

Step 3: Click on the Format dropdown. You will see all the built-in formats for date field you can choose for the date formatting.

Example 2 - Step 3

Choose a date format from the options under the Date formats label.

Power BI Date Formatting - Example 2 - Step 3 - dateformat

Step 4: Navigate to the Table view and select the table. You will notice that the Date field has been formatted per the option you selected in the previous step.

Power BI Date Formatting - Example 2 - Step 4

Step 5: Navigate to Column tools and change the Data type to Date/time.

Example 2 - Step 5

Step 6: Click on the Format dropdown. You will see different formatting options under Common formats, Date formats, and Date/time formats labels.

Example 2 - Step 6

Step 7: Select a formatting option from the Format dropdown.

You will notice the Date column has been formatted to the option you have selected in the previous step.

Power BI Date Formatting - Example 2 - Step 7

Important Things to Note

  • Ensure that the column you’re formatting as a date is recognized as a Date data type in Power BI. If not, the formatting options may not work as expected.
  • Consider time zone considerations, especially if your data uses UTC (Coordinated Universal Time). Adjust the time zone settings in Power BI to display dates in the desired time zone.
  • After making date format changes, refresh your data to see the updated formatting in your reports.
  • Power BI allows for custom date formatting using format strings. Familiarize yourself with date format strings (e.g., “yyyy-MM-dd”) to create custom date formats.

Frequently Asked Questions (FAQs)

1. Why is Power BI date format not changing?

Power BI’s date format may not be changing for several reasons, which may include:

Ensure that the column you are trying to format as a date contains date values and is recognized as a date data type in Power BI.
Power BI allows you to format date fields at different levels: at the field level, in visuals, or table columns.
Sometimes, your data source can store date values in UTC (Coordinated Universal Time) format. When you display these dates in Power BI, they are in the UTC format. 
• Power BI offers custom date formatting. If you’re trying to apply a specific custom format, make sure you are using the correct custom format string. For example, “yyyy-MM-dd” for a date in the format “2023-09-08.”
• If you’ve changed your date formatting, ensure you’ve refreshed the data in your Power BI report to see the updated formatting.

2. What is the difference between Power BI date and time format?

Some of the key differences between Power BI date and time format are highlighted as follows:

Date Format: Date format in Power BI is used for displaying and formatting date values. You can specify how dates are displayed, such as “dd-MMM-yyyy” (e.g., 08-Sep-2023).
Time Format: Time format, on the other hand, is used for displaying and formatting time values. You can specify how times are displayed, such as “hh:mm:ss” (e.g., 14:30:00).

3. How do I change a Number to date format in Power BI?

• You can use the DATE function to change a number to a date format in Power BI. Suppose you have a column containing numerical values representing dates (e.g., Excel-style date serial numbers). You can create a new calculated column to convert these numbers to dates. Here’s an example formula:
• NewDateColumn = DATE(YearColumn, MonthColumn, DayColumn)
• Replace YearColumn, MonthColumn, and DayColumn with the appropriate column names from your dataset. This formula will create a new column with date values based on the provided year, month, and day numbers.
• Once you have this new date column, you can format it as a date using the steps mentioned earlier to ensure it’s displayed correctly in your visuals.

This has been a guide to What Is Power BI Date Formatting. We learn the ways to modify date format on both table & visuals of existing data fields. You can learn more from the following articles –

Power BI Career

SUMX in Power BI

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *