Forum Discussion

SoulCuber's avatar
SoulCuber
Frequent Visitor
9 years ago
Solved

create own date format dd d-MMM-yy

I would like to display dates in charts including the weekday.

 

There is one standard option available which is: Wednesday 1 March 2001 (dddd d MMMM yyyy)

 

However for display purposes, I would prefer a shorter weekday notation, e.g. We 1-Mar-2001 (dd d-mmm-yy)

 

Are there any options to define other formats than those listed?

  • Anonymous's avatar
    Anonymous
    9 years ago

    You can create a calculated column, and use the FORMAT( ) function to specify any format string you desire :)

  • If in Power Query (Query Editor), you can use Date.ToText() function for the same goals.

    Just dont forget to set "sort by column" option later when modelling data

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You can create a calculated column, and use the FORMAT( ) function to specify any format string you desire :)

    • SoulCuber's avatar
      SoulCuber
      Frequent Visitor

      Clever idea, many thanks Maxime and Scotsen!

      • GenoRockMdt's avatar
        GenoRockMdt
        Frequent Visitor

        We should not need to be so clever honestly... What is wrong with just letting people define whatever date format they want to show - just like Excel does? 

         

        The Format option in Modeling shows the underlying elements... MMMM, MMM, MM, M, dd, ddd, hh, mm, etc...

         

        What is so hard about making this easy?  The list in Power BI is actually missing the most critical formats in my opinion for designing good, compact visuals...  yyyy-mm-dd and dd-mmm-yyyy

         

        Format and such convert to Text which doesn't sort correctly.  Doing some sort of back-side sort is not what one would call friendly.

  • hohlick's avatar
    hohlick
    Continued Contributor

    If in Power Query (Query Editor), you can use Date.ToText() function for the same goals.

    Just dont forget to set "sort by column" option later when modelling data