Create Date Table or Calendar in Power Query M (Complete Guide)

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 53

  • @JSong-p1k
    @JSong-p1k Рік тому +3

    Your voice is so calm and smooth. Way better than some accents. I enjoy listening, Thank you

  • @chakrabmonoj
    @chakrabmonoj 2 роки тому +2

    Fantastic lesson -much simpler and effective than many other lesson I wasted my time watching. Thank you for posting this!

  • @maxivy3299
    @maxivy3299 2 роки тому +2

    Amazing lesson. Also really really helpful that you wrote the code for relative week in power query. You are a Jedi Master

  • @raitup00
    @raitup00 2 роки тому

    Omg! in your blog you have more information about the topic, and with lot of details. Thanks for sharing your knowledge in Power query / BI

  • @rdaleprice7184
    @rdaleprice7184 2 роки тому +9

    Great video! It would help to explain how to set up the Date Parameters at the first of the video.

  • @HYHY4646
    @HYHY4646 2 роки тому +1

    This is everything I needed! Thank you!
    For your reference, my default Canadian setting showed day of week as Saturday as 6 and Sunday as 0, so I ended up with something like
    = Table.AddColumn(#"Added Custom2", "Is Weekend", each if Date.DayOfWeek([Date]) = 0 or Date.DayOfWeek([Date]) = 6 then "Weekend" else "Weekday")

  • @williamarthur4801
    @williamarthur4801 3 роки тому +2

    Thanks really succinct and understandable, also you seem to be the only person (this refers to website rather than youtube tutorial) who has bothered to explain the #duration syntax, which is straight forward.
    ONCE YOU KNOW IT. So thanks again.

  • @suki9860
    @suki9860 2 роки тому +1

    Great tutorial, Rick! Very informative, and useful. Thanks!

  • @JanBolhuis
    @JanBolhuis Рік тому

    Great video and explanation. Thank you.

  • @andreeamorgociu2541
    @andreeamorgociu2541 Рік тому

    Thank you! This is very useful 😃.

  • @mercspalms9672
    @mercspalms9672 2 роки тому +2

    How do I make the start date to be the current month every time I refresh the data? I am working with an open order report and I am trying to pull only the 12 months ahead (opposite of a trailing 12 monthly report).

  • @mnowako
    @mnowako 3 роки тому +1

    Excellent! Thank you!

  • @egordontov9814
    @egordontov9814 2 роки тому

    Thank you for this
    Do you need to reference start and end dates parameters from calendar table?
    Or isn it picked up automatically?

  • @txreal2
    @txreal2 Рік тому +1

    What if my columns are datetime? I also need to work with time, beside date.
    Thanks! follower subscriber

  • @mesfinzewdu7420
    @mesfinzewdu7420 Рік тому

    Great video, I was looking for how to create a Month start and Month end fiscal column, which the Month ends at the last Saturday of each month and the Month starts at the following Sunday of each month. If possible please create another lesson.

  • @wasfiathhar
    @wasfiathhar Рік тому +1

    could you please share how to calculate ISO week number

  • @Contentkashyapa
    @Contentkashyapa 2 роки тому

    Thank you, sir.

  • @nelson_k_d
    @nelson_k_d Рік тому

    Create date table with parameter:
    = List.Dates(StrtDt, Duration.Days (EndDt - StrtDt) + 1, #duration(1,0,0,0))
    StrtDt & EndDt have been imported from two tables in excel, dates can be changed in excel without opening the query.
    The dates are then drilled to form items, used in the above formula to create a datetable :)

  • @NigelMayhew1
    @NigelMayhew1 2 роки тому

    Thank you!

  • @AndréDubé-l6g
    @AndréDubé-l6g 11 місяців тому

    Hi I have created the startdate and enddate query using List.Min and List.Max and table name and column. When I created the calendar tables using these two, it's really long to get to the end. Samething each time I'm creating, the Year, Month, etc columns. Is this normal?

  • @victorarayal
    @victorarayal 2 роки тому

    Great video!
    Is there a easy way to add columns to show if a day is in the last month, or in the last 6 months or in the last year?

  • @BrianMatthews-xs4pl
    @BrianMatthews-xs4pl 2 роки тому +1

    Is there and easy way to create a relative week index or offsets to this calendar?

    • @BIGorilla
      @BIGorilla  2 роки тому +1

      Yep! You can use
      Table.AddColumn(#"Add Day Offset", "Week Offset", each ( Number.From( Date.StartOfWeek( [Date], Day.Monday) )- Number.From( Date.StartOfWeek( Today, Day.Monday ) ) ) / 7, Int64.Type )
      See the code examples at : gorilla.bi/power-query/date-table/#calendar-script

  • @andreinamontesinos870
    @andreinamontesinos870 2 роки тому

    What about if my week stars on Sunday instead of Monday?, like from sunday to saturday.

  • @iankr
    @iankr 3 роки тому +1

    Thanks. How do create the StartDate and EndDate parameters?

    • @BIGorilla
      @BIGorilla  3 роки тому +1

      Hey Ian,
      You can do that at the 'Manage Parameters' button in the ribbon.
      Cheers,
      Rick

  • @saraherigdon
    @saraherigdon 2 роки тому

    I'm a complete newb to all things Power BI. In my attempt to follow the steps in this tutorial, I am not getting past Column1 generating from the New Query at 1:28. I appreciate any help (or if someone can tell me if I need to do something further with my StartDate and EndDate querries beyond creating them with the parameters of Type = Date, Suggested Values = Any value, Current Value = (the date I chose for start/end).

    • @BIGorilla
      @BIGorilla  2 роки тому +1

      Hey Sarah. Please have a quick look at my blog, where you will find exactly how to create the parameters: gorilla.bi/power-query/date-table/
      Enjoy’

  • @RonDavidowicz
    @RonDavidowicz 3 роки тому

    Nice, now can you show us what we can do with this calender query?

  • @txreal2
    @txreal2 Рік тому

    Instead of using parameters, how can I import the Start Date and End Date from Excel (user inputs) and use those dates? Thanks.

    • @nelson_k_d
      @nelson_k_d Рік тому

      = List.Dates(StrtDt, Duration.Days (EndDt - StrtDt) + 1, #duration(1,0,0,0))
      StrtDt & EndDt have been imported from two tables in excel.
      The dates are then drilled to form items, used in the above formula to create a datetable :)

  • @angelicaribeiro3717
    @angelicaribeiro3717 2 роки тому

    How do I create a function to count business hours?

  • @ramruttunaubeeluck9235
    @ramruttunaubeeluck9235 2 роки тому

    How to know which function to use and how to remember all these functions please?

    • @BIGorilla
      @BIGorilla  2 роки тому +1

      Just start somewhere and add them to your repertoire. Slowly but surely you’ll remember. And you can google what you forget. No need to remember everything :)

    • @ramruttunaubeeluck9235
      @ramruttunaubeeluck9235 2 роки тому

      @@BIGorilla Thank you Sir

  • @ajmacconville1
    @ajmacconville1 2 роки тому

    Thanks! Do you know how to create a calendar format 📅 with data from a table. I have data of events with different features and want to view them in a calendar, and be able to view the different features, e.g. event type, event lead etx

  • @RicardoSilva-oc9fb
    @RicardoSilva-oc9fb 2 роки тому

    Hi Rick, i want Monday to be 1 and Sunday to be 7, instead of being 0 to 6. How?

    • @BIGorilla
      @BIGorilla  2 роки тому

      You take regular formula and add + 1 to it. There's no other way unfortunately...

  • @aryastark5886
    @aryastark5886 3 роки тому

    Hello 👋 maybe you could help me about other topic but related to date as well.
    Problem : For my End date, I want to get the end of the month (date format) of my previous month as of today end of month local now values. Would this be possible?
    Example;
    Today EOM: Feb 28, 2022
    Goal
    Prev EOM: Jan 31, 2022
    Hope you can help me resolve this one. Many thanks 😊

    • @BIGorilla
      @BIGorilla  3 роки тому

      Hi Arya,
      One way is to :
      1. Use Date.StartOfMonth on your date
      2. Then Date.AddDays with-1 as parameter to retrieve the previous day
      Hope that helps! 🔥

    • @aryastark5886
      @aryastark5886 3 роки тому

      @@BIGorilla Hi, thank you for your response, much appreciated :)
      So basically I tried it on my end and it seems that there something wrong , could further help on this. Below is my current synxtax
      = Date.StartOfMonth(Date.AddDays(DateTime.Date(DateTime.LocalNow()),-1))
      Output is this
      01/02/2022

    • @BIGorilla
      @BIGorilla  3 роки тому +1

      @@aryastark5886 date.adddays should come first in the formula (so applied last). And before the date.startofmonth.
      👌

    • @aryastark5886
      @aryastark5886 3 роки тому +1

      @@BIGorilla Omg it works !! 🔥🔥 Thanks so much for your help! 😊

  • @rrrraaaacccc80
    @rrrraaaacccc80 2 роки тому

    💯👍

  • @thilagalaxmi4768
    @thilagalaxmi4768 Рік тому

    how to create quarter

  • @ashokedas7231
    @ashokedas7231 Рік тому

    Pl creat calander table

  • @thilagalaxmi4768
    @thilagalaxmi4768 Рік тому

    I mean like Q1

  • @kebincui
    @kebincui 3 роки тому +1

    👍👍🌹🌹

  • @pieterlinden8292
    @pieterlinden8292 2 роки тому

    Oh.... you hid the setting the (StartDate, EndDate) in the code further down!
    Referencing a column name in a table results in a list. To get the latest sales date we can therefore use the List.Max function:
    = List.Max( Sales[Date] )
    With this parameter in place, you can now reference the MaxSalesDate instead of the EndDate Parameter.

  • @VikasKumar-vo6wo
    @VikasKumar-vo6wo Місяць тому

    Fiscal week number