Forum Discussion

Sow-1's avatar
Sow-1
New Member
1 year ago
Solved

Date formatting

Need help in formatting the date column in the below format

ddd, dd MMM, yyyy (Fri, 22 Nov,2024).
 
Used the measure for column as below however it is converting the date into text.
FORMAT(table[Date], "ddd, dd MMM, yyyy")
 
 
  • Hi Sow-1 ,

    Make sure your data type is set for Date, and in format field past the the follow string: ddd, dd MMM, yyyy

     

    Your final result will look like this:

     

     

5 Replies

  • Hi Sow-1 

     

    You can change a column's format either at the semantic model or visual level. Please see the screenshots below:

     

  • Hi Sow-1 ,

    Make sure your data type is set for Date, and in format field past the the follow string: ddd, dd MMM, yyyy

     

    Your final result will look like this:

     

     

  • 123abc's avatar
    123abc
    Community Champion

    It looks like you’re using DAX in Power BI to format your date column. The FORMAT function indeed converts the date into text. If you need to keep the date as a date type while displaying it in the desired format, you might need to handle the formatting at the visualization level rather than in the data model.

    However, if converting to text is acceptable for your use case, you can use the FORMAT function as you did. Here’s the correct syntax:

    FormattedDate = FORMAT(table[Date], "ddd, dd MMM, yyyy")

    If you need to keep the date type, you can use the following approach in Power BI:

    1. Create a calculated column with the formatted date as text.
    2. Use this column in your visuals where you need the specific format.

    If you need further assistance with Power BI or any other tool, feel free to ask!

  • Sow-1 

    In Power BI, the FORMAT function converts a value into a text string. Since you need to keep the column as a "Date" data type, FORMAT alone won't suffice. Unfortunately, Power BI does not allow for custom date formats directly while retaining the data type as Date.

     

    Go to the Power Query Editor.
    Duplicate the Date column.
    Format the new column using Power Query's built-in options (under "Transform" → "Format").
    Use the original Date column for calculations, and the formatted text column for display.

     

    💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn