Creating a MTD/QTD/YTD Time Intelligence Slicer in Power BI

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 244

  • @matheusbergamo4295
    @matheusbergamo4295 Před 3 lety +18

    For those, like me, that tried to make it work with WTD as well, i made it like this:
    var WeekStart = CALCULATE(TodayDate-WEEKDAY(TodayDate,2),YEAR(Data[Data])=YEAR(TodayDate))

    • @virgovinay
      @virgovinay Před 3 lety

      is it possible to get Last Week and last month formula

    • @tinaflemons4022
      @tinaflemons4022 Před 2 lety

      How did you enter the previous week?

    • @shripadv2607
      @shripadv2607 Před rokem

      Hey .... Nice! can you help in getting the ptd done in same way .... ex if the start of fiscal preiod is as below
      fiscal_period_num fiscal_period_start_date fiscal_period_end_date
      1 2023-01-29 2023-02-25
      2 2023-02-26 2023-03-25
      3 2023-03-26 2023-04-29
      4 2023-04-30 2023-05-27
      5 2023-05-28 2023-06-24
      6 2023-06-25 2023-07-29
      7 2023-07-30 2023-08-26
      8 2023-08-27 2023-09-23
      9 2023-09-24 2023-10-28
      10 2023-10-29 2023-11-25
      11 2023-11-26 2023-12-30
      12 2022-12-25 2023-01-28
      12 2023-12-31 2024-02-03

  • @katiawei6817
    @katiawei6817 Před 11 měsíci +1

    Brilliant solution to YTD MTD buttons. Thank you soooooooooooooooo much for the sharing.

  • @atifmir7409
    @atifmir7409 Před 4 lety +3

    This is a lovely time intelligence addition. I'll be adding this to one of my reports. Thanks

  • @satishkumardommeti8282
    @satishkumardommeti8282 Před 3 lety +3

    Excellent. Simple yet powerful approach.

  • @adamsidebottom5023
    @adamsidebottom5023 Před 4 lety +2

    Hey there, a really well explained video. This was the first real DAX work I've done and I managed to follow it and create the functionality. I even used the prinicples to add a "Yesterday" in there as well!

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      Thanks! Yeah there's another great video follow up to this one too that talks about other time intelligence perspectives. czcams.com/video/xCHnjzgfLG8/video.html

  • @user-dn2bz7iv6p
    @user-dn2bz7iv6p Před rokem +1

    I would like to add previous Month to the selection + 3prior months
    PreviousMonth = if current month is march, previous month would be 01/02/2023 - 28/02/2023
    3 prior months : if current month is march, prior 3 months would be 01/12/2022 - 28/02/2023

  • @junaidmalik9593
    @junaidmalik9593 Před 4 lety +2

    Man i am like waiting restless for every video or ur's.

  • @AndyBearYT
    @AndyBearYT Před 2 lety +2

    if you wanted to change the order of the items in the slicer so it shows YTD, QTD, MTD you can add a column to the table in the code and then sort the selections based on that. For Example - ADDCOLUMNS(
    CALENDAR(YearStart, TodayDate),
    "Selection", "YTD", "Order", 1)

    • @HavensConsulting
      @HavensConsulting  Před 2 lety +1

      Hi there, that's absolutely correct. Adding a custom sort column would allow you to control the slicer order if needed. Thanks for mentioning.

  • @axelveronr
    @axelveronr Před 4 lety +8

    Hi! thank you for this wonderful video! I have a little question, what is the information from Data[month year]? because I have a table with 12 dates (start year date 09/30/2019 and end year date 08/31/2020) but when I replace the information with my table it got an error : "The start date in Calendar function can not be later than the end date". Could you please let us know how can we replace the table month year?

  • @Doffskii
    @Doffskii Před 4 lety

    Nice use of relationship! I will definitely try this out. Normally I use the pattern with disconnected slicers and switch formulas so I'm excited to see this from a performance perspective. If the selection table can be calculated in PQ it can be stored in data flows for reuse in other models, but alot more fun crunching out a good DAX code ;)

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Good question, Holly also asked a similar question in these comments last month. I'll copy/paste my answer to that here as well :)

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      It's a bit tricky, since you can't point this DAX Generated table at your calendar table without creating a circular dependency error. Two solutions I can think of: A) if your calendar table is made in PQ, you can point this table's logic to the date column on that table. This would be my recommended option. Or option B) is create a separate disconnected DAX calendar table using the CALENDER function, same start/end date as your calendar table. Then hide it in your model, and point the date selection logic to that date field in there, since it's a continuous date range.

    • @nehachak
      @nehachak Před 10 měsíci

      ​@HavensConsulting thanks for this optimized option. But, I am facing the circular issue despite creating the date table in PQ. If that can be mitigated, it will reduce redundant measures

  • @jonathandupuis9474
    @jonathandupuis9474 Před 2 lety

    Thank you so much for this tutorial! Was very educative and well explained! Impressive work!

  • @raphaelokoye4310
    @raphaelokoye4310 Před 4 lety +3

    Nice job!. How do I modify the formula to accommodate YTD LY, MTD LY and QTD LY?

    • @andrefreitas1572
      @andrefreitas1572 Před 2 lety +1

      Hi, I fixed it! I've also adapted the code to use the latest date of the calendar table instead of today's date (as the dashboard might not be updated, it's just for best practice).
      I've also added WTD and Yesterday's date (so it's a complete code in my opinion :) )
      To briefly explain what I've done: I've extended the calendar to also display LY dates of the same period from YTD, QTD, MTD, WTD, Yesterday.
      Please find my full code below.
      Daily/WTD/MTD/QTD/YTD Selection =
      VAR LatestDate = LASTDATE('dim Calendar'[Date]) - 1
      VAR YearStart = CALCULATE(STARTOFYEAR('Fact GMC Sales'[Date]),YEAR('Fact GMC Sales'[Date])=YEAR(LatestDate) )
      VAR QuarterStart = CALCULATE(STARTOFQUARTER('Fact GMC Sales'[Date]), QUARTER('Fact GMC Sales'[Date]) = QUARTER(LatestDate),YEAR('Fact GMC Sales'[Date])=YEAR(LatestDate) )
      VAR MonthStart = CALCULATE(STARTOFMONTH('Fact GMC Sales'[Date]), MONTH('Fact GMC Sales'[Date]) = MONTH(LatestDate),YEAR('Fact GMC Sales'[Date])=YEAR(LatestDate) )
      VAR WeekStart = CALCULATE(LatestDate-WEEKDAY(LatestDate, 2),YEAR('Fact GMC Sales'[Date])=YEAR(LatestDate))
      VAR LY_LatestDate = SAMEPERIODLASTYEAR(LASTDATE('dim Calendar'[Date])) - 1
      VAR LY_YearStart = CALCULATE(STARTOFYEAR('Fact GMC Sales'[Date]),YEAR('Fact GMC Sales'[Date])=YEAR(LY_LatestDate) )
      VAR LY_QuarterStart = CALCULATE(STARTOFQUARTER('Fact GMC Sales'[Date]), QUARTER('Fact GMC Sales'[Date]) = QUARTER(LatestDate),YEAR('Fact GMC Sales'[Date])=YEAR(LY_LatestDate) )
      VAR LY_MonthStart = CALCULATE(STARTOFMONTH('Fact GMC Sales'[Date]), MONTH('Fact GMC Sales'[Date]) = MONTH(LY_LatestDate),YEAR('Fact GMC Sales'[Date])=YEAR(LY_LatestDate) )
      VAR LY_WeekStart = CALCULATE(LY_LatestDate-WEEKDAY(LY_LatestDate, 2),YEAR('Fact GMC Sales'[Date])=YEAR(LY_LatestDate) )
      VAR Result =
      UNION (
      ADDCOLUMNS(
      CALENDAR(YearStart, LatestDate),
      "Selection", "YTD",
      "SortId", 5
      ),
      ADDCOLUMNS(
      CALENDAR(LY_YearStart, LY_LatestDate),
      "Selection", "YTD",
      "SortId", 5
      ),
      ADDCOLUMNS(
      CALENDAR(QuarterStart, LatestDate),
      "Selection", "QTD",
      "SortId", 4
      ),
      ADDCOLUMNS(
      CALENDAR(LY_QuarterStart, LY_LatestDate),
      "Selection", "QTD",
      "SortId", 4
      ),
      ADDCOLUMNS(
      CALENDAR(MonthStart, LatestDate),
      "Selection", "MTD",
      "SortId", 3
      ),
      ADDCOLUMNS(
      CALENDAR(LY_MonthStart, LY_LatestDate),
      "Selection", "MTD",
      "SortId", 3
      ),
      ADDCOLUMNS(
      CALENDAR(WeekStart, LatestDate),
      "Selection", "WTD",
      "SortId", 2
      ),
      ADDCOLUMNS(
      CALENDAR(LY_WeekStart, LY_LatestDate),
      "Selection", "WTD",
      "SortId", 2
      ),
      ADDCOLUMNS(
      CALENDAR(LatestDate, LatestDate),
      "Selection", "Yesterday",
      "SortId", 1
      ),
      ADDCOLUMNS(
      CALENDAR(LY_LatestDate, LY_LatestDate),
      "Selection", "Yesterday",
      "SortId", 1
      )
      )
      Return
      Result

  • @mwaltercpa
    @mwaltercpa Před 4 lety +2

    Great practical solution Reid! Thank you! The Dax table using Union will be a nice add to my go-to tools, and faster calcs as a bonus!

  • @zachdigan4666
    @zachdigan4666 Před 4 lety

    This is exactly what I was looking for! Two questions: 1) is it possible to apply this selector so that you can do YoY calculations or would you need 2 selectors? 2) How did you get around the multiple column error?

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      Hi there, if you're looking to calculate YoY values, that would be more suited for a DAX measure itself. Otherwise as you mentioned you would need to have the slicer show both years in the filter. I'm not sure what you mean about the "multiple column error"

  • @kurzashane
    @kurzashane Před 4 lety +2

    If our date table has relationships both active and inactive to other tables how do we avoid a circular dependency?

  • @mayurpawar4984
    @mayurpawar4984 Před rokem +1

    Thank you for this video! Quite Impressive. I'm working on something, based on the video MTD/QTD/YTD I created the selection and the calculations seem to work fine. I had one question can we also compare with PMTD/PQTD/PYTD as well at the same time basis the MTD/YTD/QTD selections. Thanks

  • @Silvioamartinezjr
    @Silvioamartinezjr Před 4 lety

    Good stuff. Would be very helpful with selling days to calculate Avg Daily Sales, MTD Sales, QTD SALES, and YTD Sales... Maybe include Units and POs 😀

  • @DDDMFZ
    @DDDMFZ Před 4 lety +1

    Super video, very helpful.
    I have a question: what if I would like to select a month so to calculate YTD and MTD of that month, without using any formula, could I make it? Thank you.

  • @spuddgg
    @spuddgg Před 2 lety

    Hey @Havens Consulting ! Back again with another question, would you have any insight into creating a current and next quarter button into this list? would we have to designate a quarter end variable? Also, kinda stumped on how to show the next quarter in the manner as well.

    • @HavensConsulting
      @HavensConsulting  Před 2 lety +1

      Similar to the other periods you'd need to capture the start/end date of the current and next quarters. A good starting point is that I'd suggest exploring the STARTOFQUARTER functions to get some of the dates, and work your way from there :)

    • @spuddgg
      @spuddgg Před 2 lety

      Okay, so i have the quarter start variable defined and that works perfect, yet my quarterend variable seems to be creating using returning two blank values for both the quarter start and quarter end variable.
      Code for QuarterEnd
      VAR QuarterEnd = Calculate(dateadd(ENDOFQUARTER('Sales Order Fact'[Transaction Date]), +2,MONTH), MONTH('Sales Order Fact'[Transaction Date]) +2 = MONTH(TodayDate))
      what i am doing wrong here?

  • @sindibad602
    @sindibad602 Před měsícem

    HI, amazing thanks for sharing. I subscribed to the blog but still can't download the file

    • @HavensConsulting
      @HavensConsulting  Před měsícem

      Hi there, did you get the welcome email? That includes the password to the Blog Files page

  • @jackeroo75
    @jackeroo75 Před 4 lety

    Wow kept it up and you will have a huge following soon!

  • @liamtrickett5697
    @liamtrickett5697 Před 2 lety +1

    How could this effect two fact tables with different dates?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      If both fact tables are connected to the same date table that this time intelligence slicer is connected to. Then both will get filtered the same way.

  • @andrewwatson2767
    @andrewwatson2767 Před 7 měsíci

    Great video, spot on for what I needed. Question - I've a date table using calendar formula but when I link it to this dateselection table I'm getting a circular reference.
    My calendar table is linked to the min and max from my sales tables, and date selection I'm trying to link to my calendar table on date. Worst case I could link to sales table but not my preferred option.
    Any ideas?

    • @HavensConsulting
      @HavensConsulting  Před 7 měsíci +1

      Fix to that in this follow up video :)
      www.havensconsulting.net/blog-and-media/improving-the-time-intelligence-slicer-avoiding-circular-dependencies

  • @kurzashane
    @kurzashane Před 4 lety +1

    Is it possible to add a week to date selection to the panel?

  • @kannanm6039
    @kannanm6039 Před rokem

    Hi, thanks for this informative video.
    I have one quick question here, what is the data column which you used for calender date which you showed in top right corner?
    It will very helpful for me if I know the exact column.
    Thanks... Keep doing this kind of complex solution videos...

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Hi there! The workbook is available for download from our Blog Files page where you can see that and any other logic we applied for the video! Link to the Blog Files page is found in our description :)

  • @abhilashg287
    @abhilashg287 Před 6 měsíci

    SAMEPERIODLASTYEAR function is returning blank value when we have data filtered to MTD/QTD etc.
    Any idea why is this and what is the alternate way to do sameperiod last year calculations.

    • @HavensConsulting
      @HavensConsulting  Před 5 měsíci

      Without taking a look at the PBIX and seeing the actual rows in the fact table, model, and relationships. I wouldn't have enough info to diagnose this. But there's a good chance this is being caused by missing data (rows) for the prior period either on the DIM calendar table, or FACT table.

  • @90s_HipHop
    @90s_HipHop Před 3 lety +2

    Great video. Playing with this (as a newbie to PBI) I have recreated it in PQ but found the broke a LY comparison DAX measure. There was an error with SAMEPERIODLASTYEAR. Do you know if this method is incompatible? As I am new to the platform, I am still trying to figure out what methods to use for the best, especially when it comes to date selections, interactions and calculations. Thanks

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Great question. You'd use a calculation like below. Where you'd apply an ALLL function to the selection table, allowing the date function to ignore that slicer and retrieve the data from the previous year.
      Avt Tuition Same Period Last Year =
      CALCULATE ( [Avg Tuition in State],
      ALL ( 'MTD/QTD/YTD Selection' ),
      SAMEPERIODLASTYEAR ( 'Calendar'[Month Year] )
      )

  • @twinklesethi2127
    @twinklesethi2127 Před 9 měsíci

    How is the date range slicer returning dates as per the MTD, QTD, YTD selection? What is the measure against the date range slicer so that it fetches dates as per the monthly, quarterly or yearly selection?

    • @HavensConsulting
      @HavensConsulting  Před 9 měsíci

      Good questoins. Check this video description for the parts 2, 3, 4, etc that should address your above questions. :)

  • @philipposorfanos209
    @philipposorfanos209 Před 6 měsíci

    Does it work well in the case of a leap year or lead day (like 29 February 2024)?

  • @krzysiekhyla9686
    @krzysiekhyla9686 Před 3 lety

    Great staff! Really helped me a lot.
    Could you share the M code version of this? I think it would be slightly better for my case

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Thanks! This is one of those cases where it's easier to do in DAX. There's a way to do it in Power Query, but I don't have any code base or template for it.

  • @lmentzer4120
    @lmentzer4120 Před 2 lety

    This is great! Question - can I use this in conjuction with a Date Slicer so I give my users the option for MTD/QTD/YTD but also let them pick a specific date range?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      You can! But you'd want to clear one slicer, before using the other slicer. Sometimes I see people with a bookmark toggle to select between the two slicers. One visible at a time, So toggling between them switches one for the other, and clears the filter at the same time

  • @user-hq2cu7pq7h
    @user-hq2cu7pq7h Před 7 měsíci

    do you know how to solve this problem on the DAX measure? "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value"

    • @HavensConsulting
      @HavensConsulting  Před 7 měsíci

      Top search result for that error should help.
      www.sqlgene.com/2019/04/30/dax-error-the-expression-refers-to-multiple-columns-multiple-columns-cannot-be-converted-to-a-scalar-value/

  • @gowiththevind
    @gowiththevind Před 9 měsíci

    Great Video @HavensConsulting
    What if in this video, I want to add custom dates as well. How can we achieve that?

    • @HavensConsulting
      @HavensConsulting  Před 9 měsíci

      Check the description on this video to see follow up videos which hopefully helps answer your additional date range questions. :)

  • @gavinlin56
    @gavinlin56 Před 4 lety +1

    What if i want to create a WTD button. I tried, but there is no start of week DAX. Any suggestion?

    • @matheusbergamo4295
      @matheusbergamo4295 Před 3 lety

      var WeekStart = CALCULATE(TodayDate-WEEKDAY(TodayDate,2),YEAR(Data])=YEAR(TodayDate))

  • @luisedugarridosoares
    @luisedugarridosoares Před 4 lety

    Hi Reid. You had mentioned that we could also perform this calculation using the Power Query option. In terms of performance: Using DAX is faster than Power Query? Is there any threshold or a best practices saying for example up, to xxx million rows use DAX and more than xxx use Power Query? Thanks and have a good one!

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      Good question. There isn't an absolute answer for either. I do find that for a date table like this the M code would be a bit more complicated, which is why I used DAX instead. Also, with a time intelligence calculated table the end result will never be more than thousands of rows. I'd be hard pressed to see a million row plus date table. So I think DAX in this case is fine. Typically I use DAX generated tables when date logic or aggregations of values are involved, and for other table and column transformations that require actual reshaping of tables (filtering rows, removing columns, unpivoting, grouping, etc.) then I use Power Query. Hope this helps!

  • @tikku17
    @tikku17 Před 2 lety

    Hi Great video, thank you for sharing this. Quick question, how can I show MTD/QTD/YTD values of current year and previous year on the same Chart without creating three different measures for previous year. thank you.

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      You could use the measure below to fetch the prior year data for any filter on the date selection slicer
      CALCULATE ( [Measure],
      ALL ( 'MTD/QTD/YTD Selection' ),
      SAMEPERIODLASTYEAR ( 'Calendar'[Month Year] )
      )

  • @sabiretutardemir
    @sabiretutardemir Před 4 lety

    It's perfect! But i have a problem. I can't calculate last year values this way. I want to see the last year vs this year sales. For example when I click MTD, filtered only this year dates. So I can't see the last year dates. How can I see the both at the same page?

  • @elmiguel1022
    @elmiguel1022 Před 3 lety

    Great video. One question, what happen when the transactional data doesn't have the first date of the range?. For example, I don't have data for January 1st (Holiday), and the YTD range start on January 2nd. Is there any way to solve it?

  • @christamucci3001
    @christamucci3001 Před 3 lety

    Maybe this has already been asked, and I've done a lot of researching and testing but still cannot solve it. These slicers are awesome, but my measures for SAMEPERIODLASTYEAR or other parallel periods don't work this these slicers. I have a bunch of KPI Scorecards that compare this fiscal year to last fiscal year. How can I adjust the measures for last fiscal year to work with these slicers? I tried adding an additional date dimension table, but now my values for LFY mirror TFY.

  • @carlosescutia9778
    @carlosescutia9778 Před 5 měsíci

    If I wanted to do this in Excel's DAX would it work? if not how may I be able to accomplish this?

    • @HavensConsulting
      @HavensConsulting  Před 5 měsíci +1

      You can use the "Get Data" option in Excel to connect to a published Power BI semantic model. Which would let you use this time intelligence table as a slicer with a PivotTable or chart. All leveraging this model and data :)

    • @carlosescutia9778
      @carlosescutia9778 Před 5 měsíci

      Thank you!@@HavensConsulting

  • @rutujaatre11
    @rutujaatre11 Před 7 měsíci

    Hii ! I want to show previous week data for e.g. today is 19th it should show 7 to 13 data what logic i need to add for this condition as week start date and end date

    • @HavensConsulting
      @HavensConsulting  Před 7 měsíci

      Hi there! I've actually done about 4 follow up videos to this series (links in the video description).
      If you still need help with custom date periods. Then I'd probably need some more context to create these custom date ranges for you. This is the exact type of consulting work we help our clients with! Feel free to book some time with us at our contact portal if you wish to purchase some consulting hours.
      www.havensconsulting.net/contact-and-support

  • @praparnamoharana9579
    @praparnamoharana9579 Před rokem

    Hi, can you please help me out? I am getting the error : A date column containing duplicate dates was specified in the call to function STARTOFYEAR. This is not supported . The current operation was cancelled because another operation in the transaction failed

  • @anupajayakody458
    @anupajayakody458 Před 10 měsíci

    How can we adjust this to also show the same period last year figures populated with the current year figures

    • @HavensConsulting
      @HavensConsulting  Před 10 měsíci

      Check the video description for other videos in this series. SAMEPERIODLASTYEAR is addressed in those

    • @anupajayakody458
      @anupajayakody458 Před 10 měsíci

      Thank you so much for your response. I actually have a table which has columns for the current year, last year, and YOY figures. What I want to do is with the time intelligence filters, and last year values to be populated as well, can we do that??@@HavensConsulting

    • @HavensConsulting
      @HavensConsulting  Před 10 měsíci

      @@anupajayakody458 you should be able to write measures for that. Leveraging DATEADD and other time intelligence functions. Otherwise that's something that would honestly require me to look at the file, and workshop with a client! We do offer those services to help clients build out metrics. Feel free to check our website for consulting services if you're interested. :)
      www.havensconsulting.net/contact-and-support

  • @lxmisrs
    @lxmisrs Před rokem

    what would be the solution if my fiscal year starts from August and ends with July? How do I generate the YTD,QTD,MTD Slicer?

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Check the video description for parts 2, 3, and 4 which address other date and fiscal considerations :)

  • @AzizRehman0111
    @AzizRehman0111 Před 2 lety

    great technique

  • @jayalmendarez
    @jayalmendarez Před 4 lety

    Great video, is there a way to create a time intelligent slicer with options, years,month,day that whenever one is selected the x axis of a chart will change. For example I have data across many dates spanning 1 year. I want the slicer when I select month to show a bar graph with months for that year in the bottom on the x axis. If I select the day option, the bar graph will change to all the days on the x axis.

  • @samnad4972
    @samnad4972 Před 2 měsíci

    Can i show the last year sales too when i click the MTD and YTD Slicers, please need help here, kind of lost here, i have CY and LY sales in a separate table connected to a common calendar.

    • @HavensConsulting
      @HavensConsulting  Před 2 měsíci

      Some of my later videos in this series address that. Check the YT description for links to the follow up videos :)

    • @samnad4972
      @samnad4972 Před 2 měsíci

      @@HavensConsulting thanks a lot, i was kind of struggling here. The video is so helping. Thanks for the quicker response 😃

    • @samnad4972
      @samnad4972 Před 2 měsíci

      @@HavensConsulting i tried it but i got trouble getting the desired results, my 2023 and 2024 sales are located in different tables and i have connected those sales datas dates with calendar table. When i do this formula i am getting filtered only this year sales till date and last years disappear’s. How will i see last years sales from jan to till date along with current years. This is what i want. Need your assistance here 🥹.

  • @zaheeratabassum6896
    @zaheeratabassum6896 Před 2 lety

    Hi !! great Video , but can i use the same slicer to show YTD,QTD,MTD for previous period along with the Current in the same visual graph?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      You definitely can! The previous period measure would need to ignore the filter from the time intelligence table. So if you used an ALL function to ignore that table. Then either DATEADD or SAMEPERIODLASTYEAR would let you see the previous period when used in the measure.

  • @christopherchu1823
    @christopherchu1823 Před 10 měsíci

    HI, it's a really good video. Is there any method to change the refresh date time dynamically with the max value of the date in the calendar table? So, we can add a date slicer for users to pick different reference points for MTD/YTD/YTD. I have tried to change max("refresh Datetime"[DateTime]) to max('Calendar'[Date] ) but there is no luck. Thanks

    • @HavensConsulting
      @HavensConsulting  Před 10 měsíci

      Hi Christopher, I'm not sure I understand the whole question. But if you're wanting to make MTD, QTD, YTD "dynamic" with date selection. Then here's a post that can help with that :)
      community.fabric.microsoft.com/t5/Desktop/YTD-with-Date-selection/m-p/1295338#M564537

  • @michaels1813
    @michaels1813 Před rokem

    Can you default the slicer to MTD?
    Also can you add an option for prior year?

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Of course! Whatever the slicer selection is when you save + publish is the default. You can also add any range you want. You just need to define the start stop ranges for your logic. You can see I added a bunch of other ranges as well in some of my follow up videos. czcams.com/video/xCHnjzgfLG8/video.html

  • @decentmendreams
    @decentmendreams Před 4 lety +1

    What an awesome solution. Thank you .
    I have a single date column on my data. I noticed you have “Month Year” on your demonstration data table. How do I get the “Month Year?”
    Can’t wait to try this.

    • @havenscr
      @havenscr Před 4 lety +1

      Hi there, I didn't create that column myself. It just happens that the public data I use is at the month, not the day level. It's treated no differently than a standard "date" column that would have day level data. Linked from a Fact Table to a Date Dimension table. Hope this helps!

    • @decentmendreams
      @decentmendreams Před 4 lety

      Reid Havens : Okay. Much obliged for the prompt answer. Will continue to anticipate for your videos.

  • @carolinechan1118
    @carolinechan1118 Před 2 lety

    Thank you for this great video, this is exactly what I was looking for for my client !
    Though when trying to implement it, I get an error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value." : would anyone know what I've been doing wrong ?
    Thank you so much !

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      If you can provide the full DAX expression here, that would help!

    • @carolinechan1118
      @carolinechan1118 Před 2 lety

      @@HavensConsulting Hi !
      Thank you so much for your quick answer : I've actually used the exact same formula you provide, though I made the mistake of creating a first date column and not creating the table from the modelling tab.
      Now it works perfectly :)
      Thanks !

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      @@carolinechan1118 glad to hear it got fixed!

  • @zchase6631
    @zchase6631 Před 2 lety

    If the date from the data table is last date of previous month due to financial run and today date is not equal to that date, the MonthStart is returning blank value with error The start date or end date in Calendar function can not be Blank value. How to solve this?

    • @zchase6631
      @zchase6631 Před 2 lety

      I managed to solve it by taking MONTH ( Data[Month Year] ) = MONTH ( MAX ( Data[Month Year] ) )

  • @erinlindquist1785
    @erinlindquist1785 Před 2 lety

    Having issues getting the date range slicer to show values outside of what selection you choose. Example, when I click MTD, all dates outside of MTD are not showing up on date range slicer. When I click YTD, I can’t go to anything prior to this year using the date range slicer. I want to still be able to click on any date using the date range slicer. Any ideas?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Hi Erin, great question. Based on the design of this the time intelligence table filters the calendar table. To use a date range slicer outside of the time intelligence filter you'd need to clear the other slicer first. Otherwise a significant model redesign is required to use them both at the same time and not interfere with each other.

  • @andrewsmith1438
    @andrewsmith1438 Před 3 lety

    This is a great solution. One thing is can you please advise how to declare a July fiscal year?

    • @HavensConsulting
      @HavensConsulting  Před 3 lety +1

      Are you wanting a selection for FYTD?

    • @andrewsmith1438
      @andrewsmith1438 Před 3 lety

      @@HavensConsulting that would be great.

    • @HavensConsulting
      @HavensConsulting  Před 3 lety +1

      @@andrewsmith1438 I might do another video on it in the future. But for now I've uploaded an alternative file in my Blog Files page where you can download a copy of the report with a FYTD selection. 😎

    • @andrewsmith1438
      @andrewsmith1438 Před 3 lety +1

      @@HavensConsulting That is fantastic. Works perfectly. Will try to apply this logic to show Fiscal QTD as well as Fiscal PYTD etc. Really helpful. Thanks again.

  • @hemantsethiya1554
    @hemantsethiya1554 Před rokem

    I have dates for 4 years like from 2018 to 2022, at the place of today var what should I need to use.

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Hi there, I'm not sure I understand the question. Are you just wanting a relative four year window from day going back 4 years?

  • @mannilyngo3135
    @mannilyngo3135 Před 2 lety

    Hi, how can you make this dynamic so that the YTD, MTD. QTD will be based on a selected date and not the max date.

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Good question. As of today you can't update a DAX table or column with a filter or slicer selection The calculated values contained in the DAX Calculated table or column will only update during model refreshes.

  • @CHQAQC
    @CHQAQC Před 3 lety

    Great stuff, just starter learning Power BI and have got lots of use from your videos!
    For this particular example since I cannot use my DAX Calendar. I use the production Data date column which vad not a complete date range. I want a complete date range since I will use the slicer on multiple production datasets. How would you solve it?

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      It’s honestly a best practice to have a calendar table with complete year ranges. I’d consider first updating your calendar table to that. I’m also releasing a video soon showing how to grab dates for the time intelligence table from your calendar table with avoiding the circular dependency error. That’s coming in a few weeks 🙂

    • @CHQAQC
      @CHQAQC Před 3 lety

      @@HavensConsulting when I try to use my main Calendar(Date) table I receive error due to a circular referencing. When I use a separate Date table (created Only for this purpose) in the VAR statements and the main Calendar table in the union min and max function it all works. But I wonder if I can set ut up in a different to get rid of the second date table.

    • @CHQAQC
      @CHQAQC Před 3 lety

      I will keep an eye open for that video :) which video editing tool do you use to produce your videos by the way?

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      @@CHQAQC I have a video in a few weeks that solves the circular dependency issue. It'll be based on this article :)
      www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      @@CHQAQC Camtasia 2021

  • @shreyakeshari8851
    @shreyakeshari8851 Před rokem

    Hi, I have followed all the steps but getting an error while creating this table “the start date or end date in Calendar function can not be Blank value” and data is present in main table…please help me to resolve this…thanks!!

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Great question. You can avoid this issue by using dates from the calendar table! I did a follow up showing how to do this. czcams.com/video/JYywNHCKhMk/video.html

  • @TauTauTau1
    @TauTauTau1 Před 3 lety

    Is it possible to create a time intelligence slicer that looks at the past 30,60,90 days similar to what you have in this video? would you be able to make a video on that?

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      It will probably be a while before I'd get around to an update for that one. But I tried to built the file in a way to make it easy to modify. Just update each of those ranges I made to accommodate the dates you're mentioning above!

  • @nareshsingh-ez5ex
    @nareshsingh-ez5ex Před 4 lety

    Really liked your creativity!!! Just one question, I'm new to DAX... how did you create that table/measure which has selection and dates column. I tried that by manually entering data in column as MTD, QTD, YTD and tried adding another column with calendar date... CALENDAR(DATE(2020, 1, 1), DATE(2020, 12, 31))....but I'm getting error saying ...."A table of multiple values was supplied where a single value was expected". Please suggest the correct way to do that. Thanks a lot.

    • @havenscr
      @havenscr Před 4 lety

      Hi there, the easiest way is I'd recommend downloading the file from my Blog Files page, and copy/pasting the DAX code from there. You can find the link to my blog files in the video description above :)

  • @mohshalsh5965
    @mohshalsh5965 Před 2 lety

    How could i generate a dynamic table of Current/YTD/MAT with multiple selections of year month slicer?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Hi Moh, I'm not entirely sure I understand the request. Could you elaborate on the scenario or perhaps you could provide a screenshot of the concept?

  • @RajShankar66
    @RajShankar66 Před 4 lety +1

    AWESOME

  • @MelissaCornfield
    @MelissaCornfield Před 4 lety

    Is there a way to add week to this.. current week?

  • @spilledgraphics
    @spilledgraphics Před 4 lety

    Hey mate, great video! the only thing I am unsure is to have that Bi-directional relationship.... hmm I will test it. Are you certain you don´t get wierd results? Or can you have the direction to be from MTD/QTD/YTD Selection table to calendar table only and still work?

    • @havenscr
      @havenscr Před 4 lety

      Hi there, good question. There should always be considerations and testing done when it comes to bi-directional relationships. And the consultant answer of course to your question of "does it get weird results?" is "it depends". In the setup I have for the model, and the visuals I'm using, there won't be any weird issues for the end user. For these reports the user wants to filter dates ONLY by the MTD/QTD/YTD slicer, nothing else. In this case these relationships do exactly that. Your other question, can you change the direction to go from the Selection table to the Calendar table only. The answer to that is no sadly. You can pick a direction of single or both. If you pick single, the filters will naturally only travel from the calendar table to the selection table, which is opposite of the direction we want. Which is the reason I need the bi-directional turned on. You can see that in this screenshot here. www.screencast.com/t/SJ2Rhgvjbk

    • @spilledgraphics
      @spilledgraphics Před 4 lety +1

      @@havenscr mate thanks for the promptly answer, I gave it a shot to a particular model I have and it worked properly and nicely, although I will keep an eye on it becuase bi-directional relationships should be treated with caution. As for the single direction, thats correct and it does not work and hence you need to go with Bidirectional. I look forward to the part 2 video (USERELATIONSHIP function). Congrats!
      Thanks for sharing this trick, and cheers from Lima, Perú.

  • @AshokSharma-sd1nd
    @AshokSharma-sd1nd Před 2 měsíci

    How can i make this dynamic based on selected date from slicer?

    • @HavensConsulting
      @HavensConsulting  Před 2 měsíci

      Could you elaborate on what you mean by dynamic?

    • @AshokSharma-sd1nd
      @AshokSharma-sd1nd Před měsícem

      ​@@HavensConsulting I want to replace todaydate by lastdate from dateslicer. based on the selected date from slicer will change WTD,MTD and YTD.

    • @havenscr
      @havenscr Před měsícem

      You'd need to make a calculation group to do this then, A stored/imported table like in this scenario can't update the table data via a slicer selection, only model refresh.
      Instead you'd need to create a calculation group to do that, and each calc item would contain whatever relative date logic you'd want. It requires a few steps, and I don't have a video for this specifically, but hopefully this gets you started.

    • @AshokSharma-sd1nd
      @AshokSharma-sd1nd Před měsícem

      @@havenscr Thanks. Finally I found which I had been searching for, after a long time. It was not possible without your help.

  • @sarva0483
    @sarva0483 Před 3 lety

    With this relationship method, how can we calculate the Previous YTD, Previous MTD, Previous QTD etc(in one measure)...but we need to have only YTD, MTD & QTD in selection

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Good question. For any Time Intelligence measure that requires reaching outside of the date filter slicer, you'd need to apply an ALL function. Here's an example measure using SAMEPERIODLASTYEAR()
      CALCULATE ( [Avg Tuition in State],
      ALL ( 'MTD/QTD/YTD Selection' ),
      SAMEPERIODLASTYEAR ( 'Calendar'[Month Year] )
      )

  • @motlover
    @motlover Před 2 lety

    Hey,
    Any Idea if I want to add a MAT (rolling 12 months) slicer as well ? thanks a lot

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      For the start date in a "rolling 12 month" range you can use the TODAY() function - 365 to get the 12 month prior start date, and the end date is TODAY()

  • @alamsa01
    @alamsa01 Před 4 lety

    Hi Reid, this technique seems very helpful. However, I keep getting the error- "A date column containing duplicate dates was specified in the call to function 'STARTOFYEAR'. This is not supported." Same thing for startofmonth as well. I think this might have to do with the fact that my data is on a day, hours and seconds level and the demo data shows at the month and year level. However, i can not get around on how to fix this error. Any suggestions will be appreciated. Thank you

    • @shleybulock
      @shleybulock Před 2 lety

      I was having this issue as well, so for anyone who is still trying to solve this try:
      1. Create a new date column from your old date column:
      NewDateCol = INT('Table'[OldDateCol])
      2. Format this new column as Date
      3. Make sure that NewDateCol is selected in the Calendar to Data relationship instead of OldDateCol

  • @seymourburt2046
    @seymourburt2046 Před rokem

    Hi Great video, but I get this error "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

    • @HavensConsulting
      @HavensConsulting  Před rokem

      That error usually means you're referencing a full column when a single value is needed

    • @HavensConsulting
      @HavensConsulting  Před rokem

      If you can copy/paste the DAX formula here I can take a look

  • @handymangamer238
    @handymangamer238 Před 2 lety

    Suggestion, why are you using complex CALCULATE() and not just something like VAR YearStart = STARTOFYEAR(TODAY())

    • @HavensConsulting
      @HavensConsulting  Před 2 lety +1

      Good questions. You can’t have a single slicer with selections for MTD, QTD, YTD, PYTD, FYTD, etc. on a single column if you put them in a date table. You’d need a binary yes/no flag column for each. With a table like this you can build out those selections in a single column and have a slicer selection for it. 🙂

    • @handymangamer238
      @handymangamer238 Před 2 lety

      @@HavensConsulting Yes, you are correct, I realized that as soon as I asked the question :)

  • @raghavgupta6032
    @raghavgupta6032 Před rokem

    Hi, Thanks for such a great video.
    I have a doubt what if we have 2 fact tables, and pulling some of measure from it. Would that work in that case

    • @HavensConsulting
      @HavensConsulting  Před rokem

      As long as both Fact Tables are connected to this calendar table, absolutely!

    • @raghavgupta6032
      @raghavgupta6032 Před rokem

      @@HavensConsulting Thanks🙏

    • @derrickkuria4206
      @derrickkuria4206 Před rokem

      @@HavensConsulting that means we will write thew formula as many times as the tables, since the Fact table names are referenced here?

    • @HavensConsulting
      @HavensConsulting  Před rokem

      @@derrickkuria4206 unfortunately I'm not sure I fully understanding your data model. Any measure based on a fact table, with a a relationship to your calendar table/time intelligence table will filter by these date periods. With any model, you need a measure per column you want to aggregate, regardless of custom calendar periods.

    • @preethama-sc1on
      @preethama-sc1on Před rokem

      Hii @@derrickkuria4206 , Did you find out the way if we 2 facts ??

  • @tinaflemons263
    @tinaflemons263 Před 3 měsíci

    Power BI will no longer allow me to create the relationship due to circular dependency. How can I fix this?

    • @HavensConsulting
      @HavensConsulting  Před 3 měsíci

      There's a video link in the description of this video that should solve that issue for you. Part 5 of this series :)

    • @tinaflemons263
      @tinaflemons263 Před 3 měsíci

      @@HavensConsulting Thank you, that worked.

  • @atlrising
    @atlrising Před rokem

    can this be done just in Power Pivot and Power Query? does it have to be in Power BI? thank you!

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Unfortunately PowerPivot doesn't allow DAX generated tables, or bi-directional relationships. It is possible there but you'd need to build it in PQ, then also have a bridge table to allow for this many-to-many connection between this date table and your calendar table

    • @atlrising
      @atlrising Před 11 měsíci

      thank you for the response. I'm trying to first build out a reporting tool in the free version of Power Pivot/Power Query for a smaller department as our company is heavy users of Tableau and it will take a while to adopt Power BI, if at all. Would you be able to share how best to do this in Power Pivot alone sometime? Thank you for your consideration@@HavensConsulting

  • @sravankumar5763
    @sravankumar5763 Před 3 lety

    Hi i have created the ytd selection table but when creating relation ship in modeling it throwing an error as circular dependency please help me to go through that thanks in advance

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Good question. A few others have asked similar in the comments here as well. I'll provide that response here. :)

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      It's a bit tricky, since you can't point this DAX Generated table at your calendar table without creating a circular dependency error. Two solutions I can think of: A) if your calendar table is made in PQ, you can point this table's logic to the date column on that table. This would be my recommended option. Or option B) is create a separate disconnected DAX calendar table using the CALENDER function, same start/end date as your calendar table. Then hide it in your model, and point the date selection logic to that date field in there, since it's a continuous date range.

  • @venkateshthammisetty7845

    Hi Sir, is it possible to give year end date dynamically in TotalYTD DAX , so can u pls help me with this if there is a way.

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      I’ve not discovered a way to feed a dynamic date into the year end date field for that DAX function.

  • @jimbobeny
    @jimbobeny Před 3 lety

    In the example file, why is there a "Refresh DateTime" table and how did you create this... why can't DAX just reference today with TODAY()

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Good question! Each time you open the file in Power BI Desktop. TODAY()'s date will change to whatever the current date and time is. Having a Power Query refresh table enforces that the "current" refresh date time doesn't change unless you refresh that table or the entire model. You can open the query editor and see the query steps I built to make that.

  • @nuwanmenuka
    @nuwanmenuka Před 3 lety

    Ho do we do this from a Date selected from a Date Slicer. i.e. How do I pick the MTD/ YTD/ WTD from a random selected from a Date Slicer? Say 30th Apr 2021

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      With this practice of a DAX table, you can't recalculate the date ranges in that table with a slicer. You'd need to do your process entirely just with the date filters being generated and applied inside of the DAX measures.

  • @kpkdeep1118
    @kpkdeep1118 Před 4 lety

    Hello Reid, I am getting error message of "The start date or end date in calendar function can not be blank value" when I ran DAX formula for Time Intelligence Selection.. I have managed to check my relationship as this is absolutely working well. Need help to fix this error.

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      Hi there, a few things can cause a blank value error. If you can provide more detail or a copy of the file please email me at info@havensconsulting.net

    • @kpkdeep1118
      @kpkdeep1118 Před 4 lety

      @@HavensConsulting Hi , thanks for quick response. Your videos are just awesome that gets me glued every time I watch it... Unfortunately I am having customer data into the file and I am not in position but what be appreciated if you can provide troubleshooting on potential scenarios with solution may be top ones..thx for support..

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      @@kpkdeep1118 it looks like you're trying to build the table off a calendar table, or table that has BLANKS in the date column for the MIN/MAX functions. In order for this to work you'll need to point those A) at a column that doesn't have blanks, or B) before import filter out blanks from that column using the query editor. But again it is tricky to know the exact issue without looking at the file. If you're having issues you're welcome to grab a consulting hour from us, more info can be found on our contact page. www.havensconsulting.net/contact-and-support

  • @romasejal
    @romasejal Před 4 lety

    I have following error named "The start date or end date in Calendar function can not be Blank value.". Please help.

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      You need to point that function (MIN/MAX) to a date column that doesn't have any blank values in it.

  • @macrocosmique
    @macrocosmique Před 4 lety

    I've a problem with that technique, though it works great for some visual, it doesn't work for table for example, the calendar is not filtered (or maybe I did something wrong)

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      Without looking at the model I don't have enough information to know what would be causing your issue.

  • @uzmarat
    @uzmarat Před 4 lety

    Cool approach! Is it correct that it will only work for this year? There is no way to analyze previous year in the same report page? Very often I need to show this and previous years next to each other.

    • @havenscr
      @havenscr Před 4 lety

      Hi there, good question. It can work for any custom date range you’d like. You just need to specify the start / stop dates in each of the union’d tables in the DAX code. I just chose current year since that is most common

    • @havenscr
      @havenscr Před 4 lety

      Hi there, good question. It can work for any custom date range you’d like. You just need to specify the start / stop dates in each of the union’d tables in the DAX code. I just chose current year since that is most common

    • @uzmarat
      @uzmarat Před 4 lety

      @@havenscr Thanks. But I still don't see how it would be possible to have MTD TY vs MTD LY next to each other in the same table?!

    • @havenscr
      @havenscr Před 4 lety +1

      Marat Abdullaev hi there, to achieve something like that wouldn’t be a slicer. You’d create a DAX measure for current year, and one for previous. Then place them side by side in a visual

    • @rayleighsilvers2555
      @rayleighsilvers2555 Před 4 lety

      @@havenscr Hi Reid, I was able to get the year 2020 but I don't know how to it for the previous years, could you please share the formula ? Many thanks for the awesome content in your channel

  • @vishalnasre1251
    @vishalnasre1251 Před 2 lety

    When I try to create a relationship between calenderDim and MTD/QTD/YTD table it gives an error as a circular dependency.
    any idea how to solve this..?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety +1

      czcams.com/video/JYywNHCKhMk/video.html I have a video addressing just this :)

    • @vishalnasre1251
      @vishalnasre1251 Před 2 lety

      @@HavensConsulting thanks will definitely watch.

  • @derrickkuria4206
    @derrickkuria4206 Před 2 lety

    hello. Does this work for Fiscal years?My Year starts in April...

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      You'd just need to adjust the VAR StartDate to the beginning of your Fiscal Year :)

  • @al1taptap
    @al1taptap Před 3 lety

    It Says "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Here's an article explaining that error well :) www.sqlgene.com/2019/04/30/dax-error-the-expression-refers-to-multiple-columns-multiple-columns-cannot-be-converted-to-a-scalar-value/

  • @zuhebkhan6973
    @zuhebkhan6973 Před 2 lety

    Hi Sir...I tried with the code I'm getting below error in PBI file "The start date or end date in Calendar function can not be Blank value". and Blog is also not working plse help in this Sir

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Could you provide more information on what you mean by “blog not working”
      With your blank value error that means that the DAX is attempting to fetch a date from a table that doesn’t contain a row for that specific date it’s looking for and returning a blank value. There are some solutions to similar issues to this posted on other comments as well on this video. Hope this helps!

  • @virgovinay
    @virgovinay Před 3 lety

    Can you please help with Last month MTD, Last Week WTD

    • @HavensConsulting
      @HavensConsulting  Před 3 lety +1

      Hi Vinay, last month to date wouldn't work well because if you were in March past the 28th of the month, it wouldn't be able to increment forward and give an accurate PMTD anymore. As example

    • @virgovinay
      @virgovinay Před 3 lety

      @@HavensConsulting cool thank you, what about just start of the last month to end of the last month and the same for week.

  • @crispow4488
    @crispow4488 Před 3 lety

    Was able to get this to work, but it stopped my measures for SAMEPERIODLASTYEAR from working as well. Any tips on how to get that working alongside this?

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Unfortunately I don't have enough information to know, without looking at the model and the measures in more detail.

    • @crispow4488
      @crispow4488 Před 3 lety

      @@HavensConsulting I was able to replicate your selection table, that part works great. I have a bi-directional relationship between the selection table and my calendar table. My calendar table also has a one to many relationship with another data table. I believe since the relationship between selection table and calendar table is bi-directional when using selection slicer it is filtering out the ability to use SAMEPERIODLASTYEAR measures that I've written, as related to the data table.
      Appreciate any assistance and thank you for sharing this video.

    • @HavensConsulting
      @HavensConsulting  Před 3 lety +1

      @@crispow4488 I added prior year data into my fact table in my demo file, and this measure worked in returning the same period last year:
      Measure Name =
      CALCULATE ( [Avg Tuition in State],
      ALL ( 'MTD/QTD/YTD Selection' ),
      SAMEPERIODLASTYEAR ( 'Calendar'[Month Year] )
      )

    • @yuvrajbugdikattekar9158
      @yuvrajbugdikattekar9158 Před 4 měsíci

      Is this working fine,
      Same report I use multiple cards for current year and sameperiodlastyear
      I use this video I create table but I couldn't get last year data

  • @datavisuk1225
    @datavisuk1225 Před 3 lety

    Can you achieve this for financial month/years? e.g. April to March

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      Any date range can be specified. Just need to specify that in the logic of when the start/end date would be for any range. E.g. MTD, or FYTD, FQTD, etc.

  • @tinaflemons4022
    @tinaflemons4022 Před 2 lety

    Hello, how would I update to include WTD (Week to Date and LWK (Last Week)?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Hi Tina, you'd have a variable for WTD
      VAR WeekStart = CALCULATE(TodayDate - WEEKDAY(TodayDate,2), YEAR(Data[Month Year]) = YEAR(TodayDate) )
      and a new part for the bottom union
      ADDCOLUMNS (
      CALENDAR ( WeekStart, TodayDate ),
      "Selection", "WTD",
      "Sort", 4
      ),

    • @tinaflemons4022
      @tinaflemons4022 Před 2 lety

      @@HavensConsulting Thank you, I'm getting a circular dependency error

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      @@tinaflemons4022 czcams.com/video/JYywNHCKhMk/video.html this will help. 😊

  • @hollyzipperstein5584
    @hollyzipperstein5584 Před 3 lety

    I keep having an issue where I am getting a "The start date or end date in Calendar function can not be Blank value". This is due to the fact that my data table doesn't always have data early on in the month which is causing the blank start as it can't find the actual month from today's date. This ends up breaking the entire dashboard as all of my visuals are reliant on this slicer. What is my best solution for working around this?

    • @HavensConsulting
      @HavensConsulting  Před 3 lety +1

      It's a bit tricky, since you can't point this DAX Generated table at your calendar table without creating a circular dependency error. Two solutions I can think of: A) if your calendar table is made in PQ, you can point this table's logic to the date column on that table. This would be my recommended option. Or option B) is create a seperate disconnected DAX calendar table using the CALENDER function, same start/end date as your calendar table. Then hide it in your model, and point the date selection logic to that date field in there, since it's a continuous date range.

    • @hollyzipperstein5584
      @hollyzipperstein5584 Před 3 lety

      @@HavensConsulting Thank you! I had to create a new DAX Calendar but it did fix this issue!

    • @stevenstanford8618
      @stevenstanford8618 Před 10 měsíci

      I had the same problem looking at historical data with no today date. Ended up using max(date[date]) as alternative to today.

  • @bhuruu
    @bhuruu Před 4 lety +1

    This looks amazing solution. However I was wondering what if we have multiple fact table and all the fact tables have date column. In your scenario it was only 1 fact table.

    • @HavensConsulting
      @HavensConsulting  Před 4 lety

      As long as your Date Dimension table is connected to each fact table's date column. This solution would work for those as well. 🙂

    • @bhuruu
      @bhuruu Před 4 lety

      @@HavensConsulting Thanks . My question was in case of multiple fact tables, what column(from which fact) I should take for creating calculations. My different fact tables have different level of Dates.

  • @parthtiwari6802
    @parthtiwari6802 Před rokem

    Why is my MTD showing all the dates similar to YTD?

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Hi there, without seeing your model I don't have enough information to know the issue with your model. Can you provide the formula you used for your table?

  • @hanygeorge4424
    @hanygeorge4424 Před 3 lety

    is there a way to use dynamic date instead of today () in today date??

    • @HavensConsulting
      @HavensConsulting  Před 3 lety

      There isn't really. That table is only refreshed during model refreshes. The values wouldn't change when you would apply a filter from a slicer or the filters pane. Maybe someday we'll have that feature!

    • @AshokSharma-sd1nd
      @AshokSharma-sd1nd Před 3 měsíci

      ​@@HavensConsulting Can we update selected date from slicer in replace of today date to make WTD, MTD and YTD dynamic. Pls help.

    • @HavensConsulting
      @HavensConsulting  Před 3 měsíci

      @@AshokSharma-sd1nd you'd need to add a disconnected date table to your model of a list of dates, and then replace any value of TODAY() with something that grabs the slicer selection of "today" from this disconnected table. I'll make a note of doing a video about this sometime in the future. But these are the basic steps

    • @AshokSharma-sd1nd
      @AshokSharma-sd1nd Před 2 měsíci

      @@HavensConsulting throwing error is start date or end date in calendar function can not be blank.however selected value from slicer showing correct in card visual.

  • @adnanalam7200
    @adnanalam7200 Před 4 lety

    Great video. Can you post pbix for this too.

    • @havenscr
      @havenscr Před 4 lety +1

      Hi there, certainly. It’s already posted in the blog files section of my website. The link to that is in the description of my video. Hope this helps!

    • @decentmendreams
      @decentmendreams Před 4 lety +1

      Reid Havens Thanks Reid. You videos are easy to follow .

    • @havenscr
      @havenscr Před 4 lety +1

      @@decentmendreams much appreciated, thank you. :)

  • @sahmedalee
    @sahmedalee Před 2 lety

    how did you create this dynamic date title?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      Great question! You can download the PBIX file from our Blog Files page and it'll have the DAX measure in it. Each video has that link in the description and I'll also include it here. www.havensconsulting.net/blog-files

  • @csrajaraman
    @csrajaraman Před 4 lety

    Where is the part2 of this video?

  • @lazydrain
    @lazydrain Před 2 lety

    But I have a lot of data tables, can I still use this?

    • @HavensConsulting
      @HavensConsulting  Před 2 lety

      As long as they’re connected to the same calendar table, yes. 🙂

    • @lazydrain
      @lazydrain Před 2 lety

      @@HavensConsulting then which date data from my data tables should I use with the dax formula? Any of them? As long as they are connected?

    • @havenscr
      @havenscr Před 2 lety

      @@lazydrain you could use the CALENDARAUTO function which scans all date columns and grabs the earliest and latest dates

  • @kastenivkimbo5347
    @kastenivkimbo5347 Před rokem

    Is it relevant even in 2023 or there's simpler approach available

  • @deenap2671
    @deenap2671 Před rokem

    Throwing out a hail Mary here as this video is two years old but for some reason, my date column goes all the way back to the 1900's. What could I be doing wrong?

    • @HavensConsulting
      @HavensConsulting  Před rokem

      Hi there! That would mean you have a date field with a date value that far back. I'd check all your source date columns to see what the earliest date is. But if you're either using CALENDARAUTO or MIN on a date column that is returning a date that early, it would mean this.