How to Create Calendar Table using DAX in PowerBI | MI Tutorials

Поділитися
Вставка
  • Опубліковано 16 вер 2024
  • How to Create Calendar Table using DAX in PowerBI | MI Tutorials
    Calendar =
    VAR Days = CALENDAR ( DATE ( 2016, 1, 1 ), DATE ( 2018, 12, 31 ) )
    RETURN ADDCOLUMNS (
    Days,
    "Year", YEAR ( [Date] ),
    "Month Number", MONTH ( [Date] ),
    "Month", FORMAT ( [Date], "mmmm" ),
    "Year Month Number", YEAR ( [Date] ) * 12 + MONTH ( [Date] ) - 1,
    "Year Month", FORMAT ( [Date], "mmm yy" ),
    "Week Number", WEEKNUM ( [Date] ),
    "Week Number and Year", "W" & WEEKNUM ( [Date] ) & " " & YEAR ( [Date] ),
    "WeekYearNumber", YEAR ( [Date] ) & 100 + WEEKNUM ( [Date] ),
    "Is Working Day",not WEEKDAY([Date]) in {1,7}
    )
    www.sqlbi.com/...

КОМЕНТАРІ • 20

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

    Thanks!

  • @janpalecek1548
    @janpalecek1548 5 місяців тому

    Nice explain and usefull

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

    Thank you so much👍

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

    Thanks for this. I wanna ask cos I have a situation where my company uses an abnormal calendar system;
    Week starts on Saturdays, march, June, Sept and December has 5 weeks while the other months have 4 weeks. How do I create a calendar table with these parameters?

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

    Hi Sir how can we show variance between two dates selected in slicer

    • @testprime4248
      @testprime4248 9 місяців тому

      I used this with min and max or 2 filters
      Var A calculates min
      Var B calculates max
      Return Compare A and B
      You will need to play around with what is connected to what otherwise you get double filtered. In the end is not very elegant and is a lot of work but it works.

  • @Himanshu.bhardwaj8
    @Himanshu.bhardwaj8 7 місяців тому

    Please create video with good video quality

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

    Hi, my question would be, in my sales table, i dont have a date column, only a quater and year column, How can i create a column in the sales table that has a date i can then create a relationship with in the date table i have now made? Thank you!

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

      Why you do need a calendar table when you don’t have dates in your data ? What is it that you are looking for in the calendar table ?

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

      @@MITutorials I needed it to be able to see qtr on qtr comparison and YoY, but i have managed to do this now. Thanks for the video it was really useful

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

      Glad you were able to do it!

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

      @@TashaCafasso Hi Tasha i am having same problem where i dont have dates in my data and want to see qtr on qtr comparision
      please let me know if there's any video that helped you

  • @YT4TV-gy6cs
    @YT4TV-gy6cs 7 місяців тому

    How can I have STARTOFYEAR function in this code?

  • @raj7sam
    @raj7sam 11 місяців тому

    Good info but can you tell me what is the advantage of using the date table separately?

    • @MITutorials
      @MITutorials  11 місяців тому +1

      You will have lot of control to create customisations especially when it comes to time intelligence functions and creating custom fiscal years etc.

  • @priyankasingh2824
    @priyankasingh2824 6 місяців тому

    Screen is entirely blur for me

  • @238_vibhavsingh7
    @238_vibhavsingh7 9 місяців тому

    I want my value in monthly basis from jan to Dec

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

    Couldn't see any thing. Zoom in when you demonstrate. Also your months were in alphabetical order, which is wrong!

    • @rdot980
      @rdot980 27 днів тому

      How do you know they are in ABC order if you can't see it? Also, it has been 10 months. Have you learned how to change that default behavior?