Тёмный

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

Havens Consulting
Подписаться 30 тыс.
Просмотров 72 тыс.
50% 1

Part one of four in a series. Learn how to leverage relationships and DAX calculated tables to create a time intelligence slicer in Power BI. The end result will perform faster and create a better user experience versus creating lots of unique time intelligence DAX measures.
RELATED CONTENT 🔗
Part 2: Applying USERELATIONSHIP Function -- • Applying the USERELATI...
Part 3: Additional Date Periods -- • Additional Date Period...
Part 4: Fiscal Periods -- • Fiscal Periods Time In...
Part 5: Avoiding Circular Dependencies -- • Improving the Time Int...
BECOME A CHANNEL MEMBER 🎉
-- / @havensconsulting
LET'S CONNECT! 🧑🏽‍🤝‍🧑🏽 🌟
-- / havensbi
-- / reidhavens
-- / havensconsulting
VIDEO CHAPTERS 🎥
0:00 - Start of Video
0:12 - Content Intro
1:08 - Demoing the Solution
2:43 - Showing the Model Design
3:29 - Showing the DAX Measures and Tables
5:45 - Discussing the DAX Code
8:17 - Summary Discussion
HAVENS CONSULTING PAGES 📄
Home Page - www.havensconsulting.net
Blog - www.havensconsulting.net/blog-...
Blog Files - www.havensconsulting.net/blog-...
Files & Templates - www.havensconsulting.net/files...
Consulting Services - www.havensconsulting.net/consu...
Contact & Support - www.havensconsulting.net/conta...
EMAIL US AT 📧
info@havensconsulting.net
#PowerBI #PBI #microsoftpowerbi #HavensConsulting #powerplatform #microsoft #businessintelligence #datascience #office #data #digitaltransformation #dataanalytics #tableau #excel #powerapps #datavisualization #dashboard #sharepoint #python #bi #analytics #cloud #azure #bigdata #sqlserver #software #sql #dynamics #dataanalysis #yammer #microsoftpowerbi #onedrive #machinelearning #bhfyp #powerbidesktop

Наука

Опубликовано:

 

30 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 240   
@atifmir7409
@atifmir7409 4 года назад
This is a lovely time intelligence addition. I'll be adding this to one of my reports. Thanks
@satishkumardommeti8282
@satishkumardommeti8282 3 года назад
Excellent. Simple yet powerful approach.
@adamsidebottom5023
@adamsidebottom5023 3 года назад
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 3 года назад
Thanks! Yeah there's another great video follow up to this one too that talks about other time intelligence perspectives. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-xCHnjzgfLG8.html
@jonathandupuis9474
@jonathandupuis9474 2 года назад
Thank you so much for this tutorial! Was very educative and well explained! Impressive work!
@TJ34644
@TJ34644 Месяц назад
One of the best videos and approaches for MTD, QTD, YTD on RU-vid- Thank you
@HavensConsulting
@HavensConsulting Месяц назад
Wow, thanks!
@matheusbergamo4295
@matheusbergamo4295 3 года назад
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 2 года назад
is it possible to get Last Week and last month formula
@tinaflemons4022
@tinaflemons4022 2 года назад
How did you enter the previous week?
@shripadv2607
@shripadv2607 Год назад
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 9 месяцев назад
Brilliant solution to YTD MTD buttons. Thank you soooooooooooooooo much for the sharing.
@HavensConsulting
@HavensConsulting 9 месяцев назад
You're welcome!
@jackeroo75
@jackeroo75 4 года назад
Wow kept it up and you will have a huge following soon!
@junaidmalik9593
@junaidmalik9593 4 года назад
Man i am like waiting restless for every video or ur's.
@HavensConsulting
@HavensConsulting 4 года назад
Glad to hear it :)
@Doffskii
@Doffskii 4 года назад
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 2 года назад
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 2 года назад
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 8 месяцев назад
​@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
@DDDMFZ
@DDDMFZ 4 года назад
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.
@axelveronr
@axelveronr 4 года назад
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?
@Silvioamartinezjr
@Silvioamartinezjr 3 года назад
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 😀
@mayurpawar4984
@mayurpawar4984 Год назад
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
@RajShankar66
@RajShankar66 4 года назад
AWESOME
@AzizRehman0111
@AzizRehman0111 2 года назад
great technique
@krzysiekhyla9686
@krzysiekhyla9686 3 года назад
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 3 года назад
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.
@kurzashane
@kurzashane 4 года назад
If our date table has relationships both active and inactive to other tables how do we avoid a circular dependency?
@jayalmendarez
@jayalmendarez 4 года назад
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.
@zachdigan4666
@zachdigan4666 4 года назад
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 4 года назад
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"
@sabiretutardemir
@sabiretutardemir 4 года назад
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?
@user-dn2bz7iv6p
@user-dn2bz7iv6p Год назад
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
@90s_HipHop
@90s_HipHop 3 года назад
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 2 года назад
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] ) )
@elmiguel1022
@elmiguel1022 2 года назад
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?
@raphaelokoye4310
@raphaelokoye4310 4 года назад
Nice job!. How do I modify the formula to accommodate YTD LY, MTD LY and QTD LY?
@andrefreitas1572
@andrefreitas1572 2 года назад
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
@spilledgraphics
@spilledgraphics 4 года назад
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 4 года назад
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 4 года назад
@@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ú.
@luisedugarridosoares
@luisedugarridosoares 4 года назад
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 4 года назад
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!
@lmentzer4120
@lmentzer4120 Год назад
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 Год назад
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
@mwaltercpa
@mwaltercpa 4 года назад
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!
@havenscr
@havenscr 4 года назад
Glad to hear it!
@andrewwatson2767
@andrewwatson2767 5 месяцев назад
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 5 месяцев назад
Fix to that in this follow up video :) www.havensconsulting.net/blog-and-media/improving-the-time-intelligence-slicer-avoiding-circular-dependencies
@BearTVHD
@BearTVHD 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 2 года назад
Hi there, that's absolutely correct. Adding a custom sort column would allow you to control the slicer order if needed. Thanks for mentioning.
@nareshsingh-ez5ex
@nareshsingh-ez5ex 4 года назад
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 4 года назад
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 :)
@spuddgg
@spuddgg 2 года назад
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 2 года назад
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 Год назад
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?
@kurzashane
@kurzashane 4 года назад
Is it possible to add a week to date selection to the panel?
@tikku17
@tikku17 2 года назад
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 2 года назад
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] ) )
@christamucci3001
@christamucci3001 3 года назад
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.
@gowiththevind
@gowiththevind 7 месяцев назад
Great Video @HavensConsulting What if in this video, I want to add custom dates as well. How can we achieve that?
@HavensConsulting
@HavensConsulting 7 месяцев назад
Check the description on this video to see follow up videos which hopefully helps answer your additional date range questions. :)
@zaheeratabassum6896
@zaheeratabassum6896 2 года назад
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 2 года назад
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.
@kannanm6039
@kannanm6039 Год назад
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 Год назад
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 :)
@MelissaCornfield
@MelissaCornfield 3 года назад
Is there a way to add week to this.. current week?
@CHQAQC
@CHQAQC 2 года назад
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 2 года назад
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 2 года назад
@@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 2 года назад
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 2 года назад
@@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 2 года назад
@@CHQAQC Camtasia 2021
@uzmarat
@uzmarat 4 года назад
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 4 года назад
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 4 года назад
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 4 года назад
@@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 4 года назад
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 4 года назад
@@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
@decentmendreams
@decentmendreams 4 года назад
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 4 года назад
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 4 года назад
Reid Havens : Okay. Much obliged for the prompt answer. Will continue to anticipate for your videos.
@alamsa01
@alamsa01 4 года назад
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 2 года назад
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
@TauTauTau1
@TauTauTau1 3 года назад
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 3 года назад
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!
@christopherchu1823
@christopherchu1823 8 месяцев назад
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 8 месяцев назад
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
@carolinechan1118
@carolinechan1118 2 года назад
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 2 года назад
If you can provide the full DAX expression here, that would help!
@carolinechan1118
@carolinechan1118 2 года назад
@@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 2 года назад
@@carolinechan1118 glad to hear it got fixed!
@twinklesethi2127
@twinklesethi2127 7 месяцев назад
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 7 месяцев назад
Good questoins. Check this video description for the parts 2, 3, 4, etc that should address your above questions. :)
@philipposorfanos209
@philipposorfanos209 3 месяца назад
Does it work well in the case of a leap year or lead day (like 29 February 2024)?
@gavinlin56
@gavinlin56 4 года назад
What if i want to create a WTD button. I tried, but there is no start of week DAX. Any suggestion?
@matheusbergamo4295
@matheusbergamo4295 3 года назад
var WeekStart = CALCULATE(TodayDate-WEEKDAY(TodayDate,2),YEAR(Data])=YEAR(TodayDate))
@macrocosmique
@macrocosmique 4 года назад
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 4 года назад
Without looking at the model I don't have enough information to know what would be causing your issue.
@andrewsmith1438
@andrewsmith1438 3 года назад
This is a great solution. One thing is can you please advise how to declare a July fiscal year?
@HavensConsulting
@HavensConsulting 3 года назад
Are you wanting a selection for FYTD?
@andrewsmith1438
@andrewsmith1438 3 года назад
@@HavensConsulting that would be great.
@HavensConsulting
@HavensConsulting 3 года назад
@@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 3 года назад
@@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.
@motlover
@motlover 2 года назад
Hey, Any Idea if I want to add a MAT (rolling 12 months) slicer as well ? thanks a lot
@HavensConsulting
@HavensConsulting 2 года назад
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()
@abhilashg287
@abhilashg287 3 месяца назад
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 3 месяца назад
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.
@raghavgupta6032
@raghavgupta6032 Год назад
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 Год назад
As long as both Fact Tables are connected to this calendar table, absolutely!
@raghavgupta6032
@raghavgupta6032 Год назад
@@HavensConsulting Thanks🙏
@derrickkuria4206
@derrickkuria4206 Год назад
@@HavensConsulting that means we will write thew formula as many times as the tables, since the Fact table names are referenced here?
@HavensConsulting
@HavensConsulting Год назад
@@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 Год назад
Hii @@derrickkuria4206 , Did you find out the way if we 2 facts ??
@michaels1813
@michaels1813 Год назад
Can you default the slicer to MTD? Also can you add an option for prior year?
@HavensConsulting
@HavensConsulting Год назад
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. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-xCHnjzgfLG8.html
@erinlindquist1785
@erinlindquist1785 Год назад
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 Год назад
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.
@venkateshthammisetty7845
@venkateshthammisetty7845 3 года назад
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 3 года назад
I’ve not discovered a way to feed a dynamic date into the year end date field for that DAX function.
@mannilyngo3135
@mannilyngo3135 2 года назад
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 2 года назад
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.
@praparnamoharana9579
@praparnamoharana9579 Год назад
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
@kpkdeep1118
@kpkdeep1118 4 года назад
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 4 года назад
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 4 года назад
@@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 4 года назад
@@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
@sarva0483
@sarva0483 2 года назад
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 2 года назад
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] ) )
@user-hq2cu7pq7h
@user-hq2cu7pq7h 4 месяца назад
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 4 месяца назад
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/
@rutujaatre11
@rutujaatre11 5 месяцев назад
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 5 месяцев назад
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
@mohshalsh5965
@mohshalsh5965 2 года назад
How could i generate a dynamic table of Current/YTD/MAT with multiple selections of year month slicer?
@HavensConsulting
@HavensConsulting 2 года назад
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?
@zchase6631
@zchase6631 2 года назад
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 2 года назад
I managed to solve it by taking MONTH ( Data[Month Year] ) = MONTH ( MAX ( Data[Month Year] ) )
@liamtrickett5697
@liamtrickett5697 2 года назад
How could this effect two fact tables with different dates?
@HavensConsulting
@HavensConsulting 2 года назад
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.
@hemantsethiya1554
@hemantsethiya1554 Год назад
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 Год назад
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?
@csrajaraman
@csrajaraman 3 года назад
Where is the part2 of this video?
@lxmisrs
@lxmisrs 10 месяцев назад
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 10 месяцев назад
Check the video description for parts 2, 3, and 4 which address other date and fiscal considerations :)
@carlosescutia9778
@carlosescutia9778 3 месяца назад
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 3 месяца назад
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 3 месяца назад
Thank you!@@HavensConsulting
@romasejal
@romasejal 4 года назад
I have following error named "The start date or end date in Calendar function can not be Blank value.". Please help.
@HavensConsulting
@HavensConsulting 4 года назад
You need to point that function (MIN/MAX) to a date column that doesn't have any blank values in it.
@sravankumar5763
@sravankumar5763 2 года назад
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 2 года назад
Good question. A few others have asked similar in the comments here as well. I'll provide that response here. :)
@HavensConsulting
@HavensConsulting 2 года назад
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.
@atlrising
@atlrising 11 месяцев назад
can this be done just in Power Pivot and Power Query? does it have to be in Power BI? thank you!
@HavensConsulting
@HavensConsulting 11 месяцев назад
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 9 месяцев назад
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
@crispow4488
@crispow4488 3 года назад
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 3 года назад
Unfortunately I don't have enough information to know, without looking at the model and the measures in more detail.
@crispow4488
@crispow4488 3 года назад
@@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 3 года назад
@@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 2 месяца назад
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
@shreyakeshari8851
@shreyakeshari8851 Год назад
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 Год назад
Great question. You can avoid this issue by using dates from the calendar table! I did a follow up showing how to do this. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JYywNHCKhMk.html
@anupajayakody458
@anupajayakody458 8 месяцев назад
How can we adjust this to also show the same period last year figures populated with the current year figures
@HavensConsulting
@HavensConsulting 8 месяцев назад
Check the video description for other videos in this series. SAMEPERIODLASTYEAR is addressed in those
@anupajayakody458
@anupajayakody458 8 месяцев назад
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 8 месяцев назад
@@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
@hollyzipperstein5584
@hollyzipperstein5584 3 года назад
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 3 года назад
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 3 года назад
@@HavensConsulting Thank you! I had to create a new DAX Calendar but it did fix this issue!
@stevenstanford8618
@stevenstanford8618 8 месяцев назад
I had the same problem looking at historical data with no today date. Ended up using max(date[date]) as alternative to today.
@judycalvo5127
@judycalvo5127 2 года назад
How could this be adapted for Fiscal Years that do not start with January?
@HavensConsulting
@HavensConsulting 2 года назад
There's additional links in the description of additional videos showing how to deal with fiscal :)
@datavisuk1225
@datavisuk1225 3 года назад
Can you achieve this for financial month/years? e.g. April to March
@HavensConsulting
@HavensConsulting 3 года назад
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.
@vishalnasre1251
@vishalnasre1251 2 года назад
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 2 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JYywNHCKhMk.html I have a video addressing just this :)
@vishalnasre1251
@vishalnasre1251 2 года назад
@@HavensConsulting thanks will definitely watch.
@samnad4972
@samnad4972 10 дней назад
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 10 дней назад
Some of my later videos in this series address that. Check the YT description for links to the follow up videos :)
@samnad4972
@samnad4972 10 дней назад
@@HavensConsulting thanks a lot, i was kind of struggling here. The video is so helping. Thanks for the quicker response 😃
@samnad4972
@samnad4972 4 дня назад
@@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 🥹.
@adnanalam7200
@adnanalam7200 4 года назад
Great video. Can you post pbix for this too.
@havenscr
@havenscr 4 года назад
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 4 года назад
Reid Havens Thanks Reid. You videos are easy to follow .
@havenscr
@havenscr 4 года назад
@@decentmendreams much appreciated, thank you. :)
@seymourburt2046
@seymourburt2046 Год назад
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 Год назад
That error usually means you're referencing a full column when a single value is needed
@HavensConsulting
@HavensConsulting Год назад
If you can copy/paste the DAX formula here I can take a look
@derrickkuria4206
@derrickkuria4206 2 года назад
hello. Does this work for Fiscal years?My Year starts in April...
@HavensConsulting
@HavensConsulting 2 года назад
You'd just need to adjust the VAR StartDate to the beginning of your Fiscal Year :)
@hanygeorge4424
@hanygeorge4424 3 года назад
is there a way to use dynamic date instead of today () in today date??
@HavensConsulting
@HavensConsulting 3 года назад
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 26 дней назад
​@@HavensConsulting Can we update selected date from slicer in replace of today date to make WTD, MTD and YTD dynamic. Pls help.
@HavensConsulting
@HavensConsulting 25 дней назад
@@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
@sahmedalee
@sahmedalee 2 года назад
how did you create this dynamic date title?
@HavensConsulting
@HavensConsulting 2 года назад
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
@AshokSharma-sd1nd
@AshokSharma-sd1nd 2 дня назад
How can i make this dynamic based on selected date from slicer?
@HavensConsulting
@HavensConsulting 21 час назад
Could you elaborate on what you mean by dynamic?
@bhuruu
@bhuruu 4 года назад
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 4 года назад
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 4 года назад
@@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.
@tinaflemons4022
@tinaflemons4022 2 года назад
Hello, how would I update to include WTD (Week to Date and LWK (Last Week)?
@HavensConsulting
@HavensConsulting 2 года назад
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 2 года назад
@@HavensConsulting Thank you, I'm getting a circular dependency error
@HavensConsulting
@HavensConsulting 2 года назад
@@tinaflemons4022 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JYywNHCKhMk.html this will help. 😊
@jimbobeny
@jimbobeny 2 года назад
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 2 года назад
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 3 года назад
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 3 года назад
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.
@zuhebkhan6973
@zuhebkhan6973 2 года назад
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 2 года назад
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!
@handymangamer238
@handymangamer238 2 года назад
Suggestion, why are you using complex CALCULATE() and not just something like VAR YearStart = STARTOFYEAR(TODAY())
@HavensConsulting
@HavensConsulting 2 года назад
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 2 года назад
@@HavensConsulting Yes, you are correct, I realized that as soon as I asked the question :)
@virgovinay
@virgovinay 2 года назад
Can you please help with Last month MTD, Last Week WTD
@HavensConsulting
@HavensConsulting 2 года назад
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 2 года назад
@@HavensConsulting cool thank you, what about just start of the last month to end of the last month and the same for week.
@al1taptap
@al1taptap 3 года назад
It Says "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."
@HavensConsulting
@HavensConsulting 3 года назад
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/
@tinaflemons263
@tinaflemons263 Месяц назад
Power BI will no longer allow me to create the relationship due to circular dependency. How can I fix this?
@HavensConsulting
@HavensConsulting Месяц назад
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 Месяц назад
@@HavensConsulting Thank you, that worked.
@lazydrain
@lazydrain 2 года назад
But I have a lot of data tables, can I still use this?
@HavensConsulting
@HavensConsulting 2 года назад
As long as they’re connected to the same calendar table, yes. 🙂
@lazydrain
@lazydrain 2 года назад
@@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 2 года назад
@@lazydrain you could use the CALENDARAUTO function which scans all date columns and grabs the earliest and latest dates
@parthtiwari6802
@parthtiwari6802 Год назад
Why is my MTD showing all the dates similar to YTD?
@HavensConsulting
@HavensConsulting Год назад
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?
@deenap2671
@deenap2671 Год назад
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 Год назад
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.
Далее
My number 1 trick for TIME INTELLIGENCE  | Power BI DAX
11:13
Модные мальчишки
00:36
Просмотров 17 тыс.
Power BI Show Year-to-Date (YTD) Across Multiple Years
15:58
Time Intelligence in Power BI
50:27
Просмотров 6 тыс.
Gizli Apple Watch Özelliği😱
0:14
Просмотров 4,8 млн
Магниты и S Pen 🖊️
0:37
Просмотров 18 тыс.
🛑 STOP! SAMSUNG НЕ ПОКУПАТЬ!
1:00
Просмотров 134 тыс.