+ Reply to Thread
Results 1 to 5 of 5

Power Query nth day of the Month Based on date and Day of Week

  1. #1
    Registered User
    Join Date
    05-26-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    48

    Power Query nth day of the Month Based on date and Day of Week

    In power Query I need to return what occurrence of the the month each Day is. I'm given the Date and the Day "dddd". Now I need to know what occurrence of the day each date is.
    For ex: 10-9-23 was a Monday. I need to return that it was the 2 Monday in Oct.

    Please see example sheet. I have the blue columns, I need to know how to get to the orange column results.

    I need to stay in power query for this.

    Thanks for any help.

    Date Day nth Day of Month
    10/9/2023 Monday 2
    10/10/2023 Tuesday 2
    10/23/2023 Monday 4
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,336

    Re: Power Query nth day of the Month Based on date and Day of Week

    Hi alo,

    Isn't there a function in PQ that is Date.DayOfWeekName()?? Is that what you want?
    I also see a Date.DayOfWeek(). https://learn.microsoft.com/en-us/po...date-dayofweek

    Look at https://learn.microsoft.com/en-us/po...date-functions for lots more..
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    05-26-2022
    Location
    USA
    MS-Off Ver
    365
    Posts
    48

    Re: Power Query nth day of the Month Based on date and Day of Week

    THank you

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,960

    Re: Power Query nth day of the Month Based on date and Day of Week

    This proposal is based on the linked video tutorial: https://www.youtube.com/watch?v=kjOmNPoVDYs&t=3s
    The original table of all dates in October of 2023 is in column A of Sheet 2.
    The code used to produce the table in columns C:E is:
    Please Login or Register  to view this content.
    I imagine that someone can give you a more efficient code.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,417

    Re: Power Query nth day of the Month Based on date and Day of Week

    Power Query
    l
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Czeslaw; 04-06-2025 at 02:46 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Power Query website - based on date input
    By spz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2024, 10:34 AM
  2. Replies: 15
    Last Post: 11-14-2022, 11:54 AM
  3. Replies: 1
    Last Post: 10-06-2022, 11:11 PM
  4. finding a specific date based on the day of the week and the day of the month
    By mrxsimonix in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-01-2022, 05:38 AM
  5. [SOLVED] Set a date based on week of the month
    By esukei in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-09-2021, 08:19 PM
  6. Returning Week # per Month based on Date
    By 00Able in forum Excel General
    Replies: 16
    Last Post: 02-04-2012, 11:52 AM
  7. [SOLVED] How do I generate a new sheet based on date/week/month?
    By Jay in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-10-2006, 04:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1