Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How to change the number/date format?

Hello

 

I want to make the day/number format of a column to be:

 

Sat 19/03/22 14:30

 

How can I do that in both Power Query and DAX?

 

Thanks

1 ACCEPTED SOLUTION

In Power Query:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrTUNzDWNzIwMlIwNLEyNlCK1YlWMrJACJpaGUAEjQ30DUyggmYwlQaG+gZmUEEjsMpYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date Time" = _t]),
    #"Changed Type1" = Table.TransformColumnTypes(Source,{{"Date Time", type datetime}}),
    #"Inserted Day Name" = Table.AddColumn(#"Changed Type1", "Day Name", each Date.DayOfWeekName([Date Time]), type text),
    #"Inserted Merged Column" = Table.AddColumn(#"Inserted Day Name", "Date Text", each Text.Combine({[Day Name], " ", Text.From([Date Time], "es-ES")}), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Inserted Merged Column",{"Day Name"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Date Text", "Date Text PQ"}})
in
    #"Renamed Columns"

 

res.jpg

 

With DAX:

 

Date Text DAX =
VAR DayName =
    SWITCH (
        WEEKDAY ( Dates[Date Time], 2 ),
        1, "Monday",
        2, "Tuesday",
        3, "Wednesday",
        4, "Thursday",
        5, "Friday",
        6, "Saturday",
        "Sunday"
    )
RETURN
    DayName & " " & Dates[Date Time]

Dax.jpg

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

Whether the advice given by @PaulDBrown  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.


Looking forward to your feedback.


Best Regards,
Henry

Anonymous
Not applicable

@v-henryk-mstf @PaulDBrown  I have data like:

19/03/22 14:30

 

I want to make it Sat 19/03/22 14:30 in a way that we do in Excel, i.e. TEXT(A1,"DDD dd/MM/yy hh:mm")

 

Is this possible?

In Power Query:

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrTUNzDWNzIwMlIwNLEyNlCK1YlWMrJACJpaGUAEjQ30DUyggmYwlQaG+gZmUEEjsMpYAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date Time" = _t]),
    #"Changed Type1" = Table.TransformColumnTypes(Source,{{"Date Time", type datetime}}),
    #"Inserted Day Name" = Table.AddColumn(#"Changed Type1", "Day Name", each Date.DayOfWeekName([Date Time]), type text),
    #"Inserted Merged Column" = Table.AddColumn(#"Inserted Day Name", "Date Text", each Text.Combine({[Day Name], " ", Text.From([Date Time], "es-ES")}), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Inserted Merged Column",{"Day Name"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Date Text", "Date Text PQ"}})
in
    #"Renamed Columns"

 

res.jpg

 

With DAX:

 

Date Text DAX =
VAR DayName =
    SWITCH (
        WEEKDAY ( Dates[Date Time], 2 ),
        1, "Monday",
        2, "Tuesday",
        3, "Wednesday",
        4, "Thursday",
        5, "Friday",
        6, "Saturday",
        "Sunday"
    )
RETURN
    DayName & " " & Dates[Date Time]

Dax.jpg

 

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,


It doesn't seem very clear what you need, what form of raw data type do you have? Can you provide relevant screenshot information and the desired result.

How to Get Your Question Answered Quickly - Microsoft Power BI Community


Best Regards,
Henry

 

PaulDBrown
Community Champion
Community Champion

What do the values look like?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






  • I have number of days worked per week and the date the empolyee started 

The total target hours of full months worked is 100

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors