Date.DayOfWeekName Function (Power Query M)

If you want to turn a date into the weekday name it falls on, like “Monday” or “Wednesday”, Date.DayOfWeekName is the function for the job.

In this article I’ll show you how to use Date.DayOfWeekName in Power Query, with simple examples for a single date, a different language, a datetime value, a whole column, and a null.

Syntax of Date.DayOfWeekName Function

Date.DayOfWeekName(date as any, optional culture as nullable text) as nullable text

where

  • date (required, any). The date to read the weekday name from. It can be a date, datetime, or datetimezone value.
  • culture (optional, nullable text). A culture code such as "en-US" or "fr-FR" that sets the language of the name. Omit it and Power Query uses the machine’s regional settings.

Returns: the weekday name as text, for example "Wednesday". If date is null, it returns null.

In plain terms, you hand it a date and it tells you which day of the week that date is, spelled out as a word.

Example 1: Get the weekday name from a date

Find out which day of the week September 11, 2024 falls on, in English.

Date.DayOfWeekName(#date(2024,9,11),"en-US")

Result: Wednesday

The "en-US" culture gives you the English name for that date.

Example 2: Get the name in another language

Pass a different culture to get the name in that language. Here is the same date with "fr-FR" for French.

Date.DayOfWeekName(#date(2024,9,11),"fr-FR")

Result: mercredi

That is the correct French spelling, and French weekday names are lowercase by design.

This is why I always pass an explicit culture. Leave it off and the language depends on whoever’s machine runs the query.

Example 3: Read the weekday name from a datetime

Date.DayOfWeekName also accepts a datetime value. The time part is ignored and only the date is used.

Date.DayOfWeekName(#datetime(2024,9,11,14,30,0),"en-US")

Result: Wednesday

The 14:30:00 time makes no difference. You get the weekday name for the date part either way.

Example 4: Add a weekday name column to a table

The most common use is adding a Weekday column to a table of dates.

Say you have a Signups table with a UserID and a SignupDate column.

Here is the starting data:

UserIDSignupDate
U-12024-09-09
U-22024-09-14
U-32024-10-01

Set the column type to date (if your dates come in as text, convert them first with Date.FromText), add a Weekday column with Date.DayOfWeekName, then keep just the columns you need.

let
Source = Excel.CurrentWorkbook(){[Name="Signups"]}[Content],
Typed = Table.TransformColumnTypes(Source,{{"SignupDate",type date}}),
AddWeekday = Table.AddColumn(Typed,"Weekday",each Date.DayOfWeekName([SignupDate],"en-US"),type text),
Selected = Table.SelectColumns(AddWeekday,{"UserID","Weekday"})
in
Selected

Each row’s SignupDate becomes its weekday name in the new column.

The result keeps each user with the day they signed up:

UserIDWeekday
U-1Monday
U-2Saturday
U-3Tuesday

Now you can group or report on signups by day of the week. The same pattern works alongside other date helpers like Date.AddDays when you need to shift the dates first.

Example 5: A null date returns null

If the input date is null, the function returns null rather than throwing an error.

Date.DayOfWeekName(null,"en-US")

Result: null

A blank cell in your date column carries straight through as null, so a missing date won’t break the query.

Things to keep in mind with Date.DayOfWeekName

  • Pass an explicit culture for predictable output. Without it, the language and spelling follow the machine’s regional settings, so the same query can return "Wednesday" on one PC and a different language on another.
  • It accepts date, datetime, and datetimezone. For datetime and datetimezone values the time portion is ignored, so only the date drives the result.
  • null in gives null out. A blank date passes through untouched, which keeps the query from failing on missing values.
  • For sorting or maths, use the number instead. The name is text, so it sorts alphabetically, not Monday to Sunday. Use Date.DayOfWeek to get the numeric day for ordering, and use this function for display.
  • The result is plain text. You can feed it straight into other text functions, for example Text.Upper or Text.Start, to reshape the label. To format the whole date as text instead, use Date.ToText.

Common questions about Date.DayOfWeekName

What is the difference between Date.DayOfWeekName and Date.DayOfWeek?

Date.DayOfWeekName returns the weekday as a name like "Wednesday", while Date.DayOfWeek returns it as a number from 0 to 6. Use the name for display and the number for sorting or calculations. Date.DayOfWeek also takes a firstDayOfWeek argument to set where the week starts, which Date.DayOfWeekName does not have.

How do I get a short name like “Mon” instead of “Monday”?

Power Query has no built-in short-name option, so take the first three characters of the full name with Text.Start(Date.DayOfWeekName([Date],"en-US"),3).

List of All Power Query Functions

Related Power Query Functions / Articles:

I am a huge fan of Microsoft Excel and love sharing my knowledge through articles and tutorials. I work as a business analyst and use Microsoft Excel extensively in my daily tasks. My aim is to help you unleash the full potential of Excel and become a data-slaying wizard yourself.