Тёмный
No video :(

Working with Time Periods in Power BI 

Guy in a Cube
Подписаться 446 тыс.
Просмотров 100 тыс.
50% 1

How do you work with time periods in Power BI like last month? Patrick digs in to show how you can accomplish this with a little DAX.
Fourmoo Blog: www.fourmoo.co...
Phil Seamark Blog: dax.tips/2019/...
📢 Become a member: guyinacu.be/me...
*******************
Want to take your Power BI skills to the next level? We have training courses available to help you with your journey.
🎓 Guy in a Cube courses: guyinacu.be/co...
*******************
LET'S CONNECT!
*******************
-- / guyinacube
-- / awsaxton
-- / patrickdba
-- / guyinacube
-- / guyinacube
-- guyinacube.com
**Gear**
🛠 Check out my Tools page - guyinacube.com...
#PowerBI #TimePeriods #GuyInACube

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

 

17 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 81   
@moulinexm7600
@moulinexm7600 3 года назад
I started Power BI 2 months ago and watched your videos like crazy. I got certified on Monday, a big thank you guys because I could answer ,any questions thanks to your videos
@kyleparsons1735
@kyleparsons1735 3 года назад
Congrats!
@learnData-oo5yk
@learnData-oo5yk 3 года назад
Hi, i am also eyeing to get certification can you guide me how you prepare for it . thanks
@moulinexm7600
@moulinexm7600 3 года назад
@@learnData-oo5yk Depends on your pre existing level really. The exam is intended for people with minimal experience (I'd say 6 months a year ) with the tool. It's possible to compensate as I did but there are a few conditions - Practice a lot on your PC and learn by heart all main functions. Visualizations, modeling and DAX calculations. Regarding M and DAX there are not that many quesitons but about 10 - 15 out of 60 so quite substantial. However you don't need to be an expert, only mastering the base functions such as CALCULATE, FILTER or some more specific like TOPN. - Having pre experience in BI was key for me because it allowed me to answer many quesitons especially on the modeling front. With no prior experience in BI and/or data analytics I think it's very difficult.
@Dramus66
@Dramus66 3 года назад
We do something very similar. We added a sort column to ensure that the order or the slicer made more chronological sense.
@brianmeis2652
@brianmeis2652 3 года назад
This video was right on time :) I had this problem earlier today and this explanation simplified it and finally has me getting the number I expected! Thank you
@joelvargas8397
@joelvargas8397 9 месяцев назад
Question: excellent video. How could you include code to also pull same period last year?
@AJM2183
@AJM2183 3 года назад
Please do a video using a calendar that isn't Fiscal. My company uses a periodic calendar (13 periods in a year). Thanks for your hard work, your videos have helped me lots.
@AmySwayzee
@AmySwayzee 3 года назад
Omg I was just and I mean today just trying to do a calendar function. Your tutorial was perfect timing. Thank you so very much for this post and the links.
@ElvisANgoh
@ElvisANgoh 2 года назад
Hello Guy. I just wish to thank you for this video. This has been super super helpful. Had a challenge on a model I'm working on and I didn't know how to even begin formulating the question in a way that the next person would understand. I just kept researching, and I stumbled on this video, followed the link you shared from Phil, and my problem was solved like!!! Thanks again, man.
@mariannehoglindbjork
@mariannehoglindbjork Год назад
Thank you, this was really helpful for me, I needed to find next month, and now it was easy to add that in the code. I have subscribed to your instructions videos now :)
@adriansanchezr.8508
@adriansanchezr.8508 3 года назад
Yesterday I came up with almost the same solution! I've got some monthly data and I had to filter, after choosing one month, all the months from that one to January, regardless of the year (kind of a custom sameperiodlastyear). Bidirectional filtering works perfectly when you know what you're doing (even though is bad practice!). Nice video as always! 👍🏻
@moulinexm7600
@moulinexm7600 3 года назад
Or you can use the CROSSFILTER command in order to force a specific calculation to operate bidirectionnal without changing the model
@xanthopsized
@xanthopsized 3 года назад
Brilliant idea. I used a similar approach to define aging buckets (for expiry dates, invoice aging ... etc.) And as you said, I like to do all of these data acrobatics on the source. Make modeling easier for me.
@AMS17121982
@AMS17121982 3 года назад
0:58 Before watch, I use to create some columns on my date table to make this more transparent to user, for instance last N months, so they can select the last 3 months, or the current one selecting 0.
@AMS17121982
@AMS17121982 3 года назад
#"Added Last Months" = Table.AddColumn( #"Calendar", "Last Months", each let _currentYear = Date.Year(DateTime.LocalNow()), _currentMonth = Date.Month(DateTime.LocalNow()) in (_currentYear - [Year]) * 12 + _currentMonth - [MonthNumber] )
@hungerspoint7358
@hungerspoint7358 3 года назад
How to implement 15,45,60 minute time interval and display data accordingly?
@MichaelRygaard
@MichaelRygaard 3 года назад
I have a similar, yet bit different approach I have extra columns in my date table (IS_yesterday, IS_thisweek, IS_this month, IS_thisYear, IS_LTM, IS_last48hours, IS_last2years ... THEN I have a new table with this values so i can put them into a slicer for all data - this code was wery easy to do, and easy to add new column in date table (either on DW, on PQ, or as dax)
@arnaumartin6700
@arnaumartin6700 3 года назад
Hi! Let me push the limits a bit more ;)....how would you recreate the same Time Periods as Phil but with a future date? Unfortunately, for me, I have sales data for the next 12 months. Thanks in advance!
@MrAszpic
@MrAszpic 3 года назад
Excelent video! I got crazy once some time ago trying to make something similar
@kirankumarav5217
@kirankumarav5217 3 года назад
Hi Patrick :- this is an osum technique. But I have an use case for periods such as a combination of date and time Ex:Last hour,last 6 hours, last 12 hours, yesterday, last week, last month,last year. Can anything be done for this combination
@KH-ui9gv
@KH-ui9gv 3 года назад
This doesn't help when connected to analysis services multidimensional cubes. Is there a workaround using named sets or something similar when using Analysis Services multidimensional cubes as a source? Also any news on when Power BI will allow the use of named sets?
@Sri-lf7mv
@Sri-lf7mv 3 года назад
Hey you guys are amazing. I love watching your videos, Thanks for the awesome stuff😊 . On your PowerBI top menu I see External Tool, what is that? I don't see it on mine, little curious to know lol. You guys rock 🏆
@moulinexm7600
@moulinexm7600 3 года назад
That's when you install extra apps such as DAX studio that allows you to connect to the Power BI cube directly through a querying interface to write DAX code.
@zuhebkhan6973
@zuhebkhan6973 3 года назад
Hi Patrick Sir, I hope you and your loved once are safe, I want to thank you personally for helping me and each one to learn and explore their talent in power BI career. watching your videos on Power Bi I have explored myself in career, thank you from bottom of my heart. Sir...now from my management side there is a ask to show the Daily, weekly and monthly in a single slicer in dashboard which can dynamically visual on selection. for that ask I'm Struggling a lot, my request to you is help in that or make a video on that so we can achieve the ask, it will be great help for my career. Thanks in advance
@cesarmartinezetienne1260
@cesarmartinezetienne1260 Год назад
Hi I am having trouble to calculate the average between the difference of 2 dates. Let’s say delivery start vs eta. I have used averagex and then datediff. However as most of my rows don’t have a delivery start, when the calculation is made the average takes into account blank or “0”’s. So when I want to visualize it I have blank or no information. Pretty much I want a measure that only takes in count the dates with delivery dates on and average it so I can then group it by department. Hope this is clear
@user-et4tu7hm5f
@user-et4tu7hm5f Год назад
HI Patrick, love your videos, they make life as a beginner much less complicated. However, in your video you say the code for last week is easy, as a beginner not so much. Please can you share the code for the last 7 days? Thanks
@fionamercy2989
@fionamercy2989 2 года назад
Hi Patrick, I'm very new to PBI and learning a lot of tricks from you videos for my PBI works. I use the technique yes / no for the filter "last month" as this is so quick solution. I try to create the yes/no for "next month" but could not figure out. What do I have to replace the formula to get next month ? ECD_Next Month = IF ( DATEDIFF( opportunities[Est. Close Date], TODAY(), MONTH ) = 1, "yes", "no" ) Thank you!!!!
@GregoryGue
@GregoryGue Год назад
Thank you for your great content. Our time periods are not calendar fiscal Months but our month ends the last saturday of each month. I found the formula but I am having difficulty implementing it. (EOM2 = VAR A2 = 'Table'[Date] RETURN IF(A2>DATE(2011,12,31),IF(A2>IF(WEEKDAY(EOMONTH(A2,0),1)=7,EOMONTH(A2,0),EOMONTH(A2,0)-WEEKDAY(EOMONTH(A2,0),1)),IF(WEEKDAY(EOMONTH(EOMONTH(A2,0),1),1)=7,EOMONTH(EOMONTH(A2,0),1),EOMONTH(EOMONTH(A2,0),1)-WEEKDAY(EOMONTH(EOMONTH(A2,0),1),1)),IF(WEEKDAY(EOMONTH(A2,0),1)=7,EOMONTH(A2,0),EOMONTH(A2,0)-WEEKDAY(EOMONTH(A2,0),1))),EOMONTH(A2,0))
@Kabboch
@Kabboch 3 года назад
Why we don't just use the date as filter with setting that to relative!?
@RachelTamez
@RachelTamez Год назад
Is there anything for future time periods?
@dcpowered
@dcpowered 2 года назад
How about filter data by last 2 weeks dynamically? Please explain!
@khawarahmed7492
@khawarahmed7492 3 года назад
I've generally noticed DAX is quite faster than Power Query, especially in column creation like operation, want to know your reason why as you said it should be done PQ?
@pavankalyan9036
@pavankalyan9036 7 месяцев назад
How do I create duration in start date
@RowellLagman-ht1qg
@RowellLagman-ht1qg Год назад
Hi Patrick, this is very helpful! This solves half of my problem though. I have a requirement that will allow my users to select predefined date periods (current month, last x months, last year, etc) and with flexibility of selecting between dates. For example, if any of the date periods are not selected, it is defaulted to a custom date range. Is that even possible?
@dennismeier6565
@dennismeier6565 2 года назад
Great video, but I found a bug. Only on the 1st of each month does the table give an error because "Yesterday" doesn't work. On the 2nd of the month it works again. Can someone tell me how to fix this?
@ramakrishnachennupati2013
@ramakrishnachennupati2013 3 года назад
I have a scenario like when I click on monthyear column in main report the drillthrough report should show last 12 months data based on monthyear selected in main report
@singlelifeline7864
@singlelifeline7864 3 года назад
Hi could you plz explain how to put slicer like ladt n days date for ex last 7 days last 15 days slicer date and from that we can show visual data
@alisterjohn4360
@alisterjohn4360 2 года назад
hi patrick, how do i filter based on the following time period: yesterday morning at 07:00am til today 06:59am?
@gulhermepereira249
@gulhermepereira249 3 года назад
What if you had connected to the fact table instead of the calendar? We would get rid of the bidirectional relationship
@rameshmandal8457
@rameshmandal8457 3 года назад
In same scenario how can I add Last weekend and Current Week ? Required DAX Expression
@anjalisaini8306
@anjalisaini8306 3 года назад
Helloo.. your videos are very good ..I am new to Power BI.. and have explored and implemented many things.. I need help in "How to use measure value to create a new table using dax" .. for eg if measure value is "abc" then new table= abc, if measure value="abc_1" , new_table=abc_1 .using dax in power bi...( where abc and abc_1are tables in pbi ). Thanks a lot
@navarroalejo
@navarroalejo 3 года назад
I work with the duration of swimmers' tests, I need to make a ranking for the tests but the duration format has not allowed me to do this order.
@mekis888
@mekis888 2 года назад
Hi, just a side question. If I add the "Month" from a date hierarchy to a filter/visualization how I can change the format of it to show the month as a number and not the name of the month?
@kadirkkkk
@kadirkkkk 2 года назад
what is Axis Date for? i couldn't see the use of it
@tdonovan7938
@tdonovan7938 3 года назад
This is great, but when I use a calculated measure that contains SAMEPERIODLASTYEAR it doesn't produce a result. Is there any way around that?
@Mr_MicDaniel
@Mr_MicDaniel 3 года назад
Thanks for the video, it was helpful....am having an issue, i tried to adjust the Yesterday's DAX Code to show for 28days but it return a single date and when i try it on a slicer it returns just value for that particular day not in addition to values from within the time period selected. how do i go about fixing this?
@NarendraSunku
@NarendraSunku 3 года назад
Hi Patrick - as usual, this is awsome. I have question at 3:21. How come you don't see count of items in Filter Pane. I would like to hide count of slicer items in Filter Pane. Please help me.
@csrajaraman
@csrajaraman 3 года назад
Hi Patrick.. can you please help me with this one? I have data that is spread across countries. The fiscal quarter are different in few countries. Q1 for America is from Jan, while Ireland has Q1 reporting from Dec. How can I have one slicer that can identify the country and show the quarters correctly?
@bzflowerbee
@bzflowerbee 3 года назад
What if I want to compare the last year same payperiod? I have a date table with a calculation for the pay period number because our 2021 first pay period started in December 2020 then the 2020 first pay period started December 2019. Does it mean that I need to have 2 calendar tables for each year so I can pull the 2020 pay period and compare to 2021 pay period? Thanks.
@justy1979
@justy1979 2 года назад
Hi, first of all nice videos. Time periods seem to be a difficult thing. I have a problem managing time periods with a free selectable start Date and Time and also with an free selectable end Date and Time For example there is a list of 9 Million Entries with DateTime Column and i want to show only from 06.09.2021 15:00:00 to 07.09.2021 02:30:00 How can I do this? The build in date filter is not that good because time is only adjustable in the AM/PM format and the slider filter can only handle dates and not time...
@allejulien645
@allejulien645 3 года назад
Hi guc and thank you for this great video. Just one question for me, how can we hide or suppress from the X axe the closed day (ie for a ytd lean analysis) thx in advance!
@raghun2636
@raghun2636 2 года назад
how do i create these time periods from the selected date?
@barnakovacs2339
@barnakovacs2339 3 года назад
Hello, how can I calculate the average of the last 5 minutes if the date is in date and minute format? of course I also have a date table with unique values! THX guys, Barna
@AlbertoGastaldo
@AlbertoGastaldo 3 года назад
Hi Patrick nice stuff as usual :-) What about translations of “today”or “tomorrow” etc ? I have a tabular model in SSAS 2017 ok place If I add this period table I guess localization would be impossible Any idea ?
@GuyInACube
@GuyInACube 3 года назад
Translations are still a struggle with Power BI. for actual data, you'd have to account for it regardless. So, a column for english, a column for spanish, etc... Although there isn't a way to really do this automatically today. A user would need to make a selection to have it use the given language.
@thomasschaub9474
@thomasschaub9474 3 года назад
Hey Patrick - nice video! Thank you! Question... what’s my best strategy in terms of DAX / PBI for managing time intelligence for a small table based on an SP list which has multiple date values per record (eg start / stop dates for phases of a project)? Should I create a calendar table and have one active relationship and multiple inactive relationships between the calendar table and the date fields from the SP list? Or is there an easier / better strategy? Any/all insights greatly appreciated! Tnx!!
@venkateshthammisetty7845
@venkateshthammisetty7845 3 года назад
Hi Patrick, 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.
@SolutionsAbroad
@SolutionsAbroad 3 года назад
Interesting approach, just one question if I may, why do you use this instead of the standard time-intelligence functions?
@adriansanchezr.8508
@adriansanchezr.8508 3 года назад
I believe it's due to the fact that measures cannot be used as slicers! It has to be a column that filters your Calendar table
@SolutionsAbroad
@SolutionsAbroad 3 года назад
@@adriansanchezr.8508 of course! I remember facing this problem a while back actually, good shout!
@MillexD66
@MillexD66 2 года назад
Hey Patrick! When doing the 'last week' calculated column, I noticed that it starts the week on a sunday. Is there any way to let the week start on a monday instead? :)
@gopalkrishnashetty9449
@gopalkrishnashetty9449 3 года назад
A simple question. Any reason why Datediff between 10/9/1979 and 2/9/2027 gives 47 in excel and 48 in Power BI DAX. Is there some known BI issue or I'm doing it wrong.
@lucascimino1821
@lucascimino1821 2 года назад
I believe it is because PowerBI is date inclusive while Excel is not
@peterthompson9412
@peterthompson9412 3 года назад
I'm sure I'm missing something here... I'm working with a dataset where one of the fields is the 'End Date' of an item and the report I have is to allow people to work with things that are coming towards that date or are past that date. The concepts and ideas in this video seemed ideal for application... however, on my report I put a slicer for the date, and changed the filter display to 'Relative Date' and 'Dropdown'.. It presented me with a beautiful filter that allowed people to change the filter to anything from 'Last 1 day' (or yesterday) to 'Next 1 day (tomorrow).. and has Calendar years, Calendar Months, Calendar weeks as well as normal years, months and weeks.. plus I can change the value from 1 to whatever I like.. Whats more is that it displays the date range for the selection.. and no DAX is required..
@mikeanthony5337
@mikeanthony5337 3 года назад
Our big issue with relative date filter is the "yesterday" filter and the fact that the timezone in PowerBI Server is GMT and there's no way to change it. So if you're in the USA and have "yesterday" set as your filter, at some point in the afternoon that filter will start showing you today's data instead of yesterdays.
@pabeader1941
@pabeader1941 3 года назад
I read the title and was so excited. But no! What about 3 hours ago? Or 20 minutes ago? Those are Time periods. The stuff you did here are Date periods. ;(
@bjonesalt
@bjonesalt 3 года назад
Agreed. I thought it would be about time as well (though the thumbnail image has a slicer that alludes to date). Still, it was a great video!
@lalalf4535
@lalalf4535 3 года назад
This can be done using power query
@kylea.mueller6045
@kylea.mueller6045 3 года назад
If you have a time dimension table, the same concept can be applied just using hours/minutes/seconds instead of days/weeks/etc
@pabeader1941
@pabeader1941 3 года назад
@@kylea.mueller6045 I've been trying to think my way around exactly that. Should have something working by tomorrow. I think.
@balyasulistiyono7447
@balyasulistiyono7447 3 года назад
That's if. This is where I hang out now.
@cottinball80
@cottinball80 2 года назад
Error when creating the Time Period Table says: "An argument of function 'DATE' has the wrong data type or the result is too large or too small."
@kadirkkkk
@kadirkkkk 2 года назад
DON'T EVER USE THIS METHOD unless you want to calculate MOM / YOY values. This type of period filtering is not the same as filtering the date on the slicer with the RELATIVE DATE option.
@GaryMillerUK
@GaryMillerUK 2 года назад
This isn't simple. Might be worth you grading your videos for difficulty.
@BadmintonEnthusiasts
@BadmintonEnthusiasts 3 года назад
You should just go to the point as opposed to so many small talks
Далее
Gelik yoki Velik?
00:20
Просмотров 1,2 млн
Мелл хочешь сына от Дилары
00:50
Просмотров 257 тыс.
MASTERING Bar Charts in Power BI | No more Cut Labels
15:34
Comparing with previous selected time period in DAX
10:23
Handling MULTIPLE fact tables in Power BI
9:02
Просмотров 305 тыс.
Custom Date Period Selections in Power BI
10:42
Просмотров 111 тыс.
How To Make a Drillthrough Page in Power BI
16:17
Просмотров 5 тыс.
What is DAX?
17:48
Просмотров 40 тыс.
My number 1 trick for TIME INTELLIGENCE  | Power BI DAX
11:13
Gelik yoki Velik?
00:20
Просмотров 1,2 млн