5 ways to calculate last 12 months in DAX for Power BI

  Рет қаралды 48,363

BI Gorilla

BI Gorilla

Күн бұрын

Пікірлер: 64
@thomasg1610
@thomasg1610 Жыл бұрын
This is super good. You the various versions can be applied in so many other ways. Thanks for sharing!!!
@tranbinhquan
@tranbinhquan Жыл бұрын
Great tip! The option 1 is best for me since I would prefer simplicity
@teigenxayden
@teigenxayden 4 ай бұрын
Thanks for your share, it`s supper good methods. Each method is a way to understand different functions. thanks!!
@markhenderson3771
@markhenderson3771 2 жыл бұрын
Great content. Easy to listen to and understand.
@philipberthiaume2314
@philipberthiaume2314 9 ай бұрын
Thank you for sharing this video. Everything works very well.
@christophec8033
@christophec8033 6 ай бұрын
What ease ! How effective ! 👍
@nevermore631
@nevermore631 2 жыл бұрын
Thank u for that very helpful, if I add some slicers for customers or products it will work this way or not ??
@julie_chen
@julie_chen 7 ай бұрын
Learned so much 🎉🙏🙏🙏
@rreneijhorst4418
@rreneijhorst4418 Жыл бұрын
Thanxsssss a lotttt Rick The Programmer
@krishnamurthy1945
@krishnamurthy1945 3 жыл бұрын
Thank you for the valuable info , could you show how to create IndexYearMonth column ?
@eminenceenduro4552
@eminenceenduro4552 11 ай бұрын
Hi, Your content is really awesome, I need your help, how to calculate the last 12 months excluding the current month any thoughts or lead in this ?
@srenbroner5713
@srenbroner5713 2 жыл бұрын
Thanks for the video - how do I not show, the periods after the lastest period with data. In my case i have 0 value for rest of the year, as i for now only have JAn data.
@BestICan
@BestICan Жыл бұрын
Can you do a video where a date in a disconnected table (Say, an incentive program ) needs to filter a separate fact table 12 months prior to the disconnected table date and then Sum a quantitative amount? I've tried and I can't get the correct filter context working. Thanks!
@albertoguzman36
@albertoguzman36 2 жыл бұрын
Hi, How did you generate de IndexYearMonthn Colunm?
@abetarabein
@abetarabein Жыл бұрын
This is really great .. thank you so much for all your content. Can the same be done to graph the last 4 quarters based on a selected date on slicer?
@taniavandermerwe2280
@taniavandermerwe2280 24 күн бұрын
Hi, This is brilliant but these are all cumulative values. I just need it by date. I simply cannot find anyone who can return that value for me. Please help? Then it needs to show the last 12 months irrelevant of the slicer selection as well.
@sandeepmenon75
@sandeepmenon75 2 жыл бұрын
Hello, thanks for your video. I have an issue. I'm trying to calculate the Rolling 12M and what I need when it comes to the months of rolling 12 is, so for example if I'm looking in Jan 2022 then my 12 month previous should be Jan 2021 -Dec 2021 not Feb 2021-Jan 2021. Ideally, in the 12M the current month should be excluded. I used your first formula but I tried to used variables and DateADD functions to replace the MAX, but no luck. Any advice would be very helpful. thanks in advance.
@shodjenkins9315
@shodjenkins9315 Жыл бұрын
Did you get a solution?, i have the same requirement
@agnieszkas.8534
@agnieszkas.8534 2 жыл бұрын
I can't find a link to video how to do a IndexMonthYear in Power Query . It is possible to do without merging the tables ?
@BIGorilla
@BIGorilla 2 жыл бұрын
Hi. Yes that's possible. Easiest would be to group your data by year and month (also include the all details column), then sort the columns year and month. You can then add an index column. And lastly expand the detail row column. Et voila! Hope that helps
@agnieszkas.8534
@agnieszkas.8534 2 жыл бұрын
@@BIGorilla Thank you ‚ I will try - I like the way you explain things , clear and approachable !
@1310kumarrakesh
@1310kumarrakesh 3 жыл бұрын
Thankx for great info. One thing pls suggest, in my table last month having date level data, and due to this 1 to 12 showing month level and last month showing day level sales in visual, can u pls make video on this ?
@BIGorilla
@BIGorilla 3 жыл бұрын
Hi Rakesh. I'm not sure I understand your scenario
@pavankumarreddy189
@pavankumarreddy189 3 жыл бұрын
Hi Is it Same logic working for last 3 months trends in line chart
@BIGorilla
@BIGorilla 3 жыл бұрын
Absolutely!
@pavankumarreddy189
@pavankumarreddy189 3 жыл бұрын
@@BIGorilla pls make one video for last 3 months trends percentages in line chart
@BIGorilla
@BIGorilla 3 жыл бұрын
​@@pavankumarreddy189 You can use the first 4 methods shown on my blog and in the video (gorilla.bi/dax/5-ways-to-calculate-last-12-months-in-dax/) Just replace the 12 months by 3 months and you will have your required formula ready. Hope that helps! Rick
@idolsensei7
@idolsensei7 2 жыл бұрын
Hi, Thanks for sharing this. I do have one question. What if I have other data sections but doesnt need to show the 12months roll? I know the disconnected calendar works to show the 12months roll but what if in other sections of the dashboard I need to show the figures on that specific month only that was filtered. In short in one sheet, example if I filter to Jan 2022, the last 12 month's data will show but on the other section or table, only the Jan 2022 data which was filtered will show.
@sravankumar1767
@sravankumar1767 3 жыл бұрын
is this cumulative total or last 12 Months sales?
@BIGorilla
@BIGorilla 3 жыл бұрын
It's regarding the last 12 months sales :)
@sravankumar1767
@sravankumar1767 3 жыл бұрын
@@BIGorilla But here the values are not showing previous year sales when we compare it showing only cumulative total
@marcinfabis
@marcinfabis 2 жыл бұрын
Great Video. Thanks
@barttitulaerexcelbart9400
@barttitulaerexcelbart9400 3 жыл бұрын
Thanks, great video. These are nice ways to calculate a moving average. Can you use a "SELECTEDVALUE" in stead of a hard coded 12 ?
@BIGorilla
@BIGorilla 3 жыл бұрын
Hi Bart, You sure can. If you for example want to use a slicer for the period selection, that would work great!
@edwinasirifi7527
@edwinasirifi7527 Жыл бұрын
Do you have a video using slicers where you can 6 months or 3 months dynamically
@pirathebanr
@pirathebanr 2 жыл бұрын
Hey - nice video! I have an issue where if I use a date filter/slicer for my 12 month measures, it won’t show the proper row value for the given date. So to clarify if I have values for a row on every month except March 2020, and I chose March as my start month based on the filter, the row will be empty, but the subtotal/total will be correct. If I chose April 2020, it will properly show the value for the last 12 month period. Any suggestions on how to fix this?
@mohanr9522
@mohanr9522 3 жыл бұрын
Hi Rick! Thanks for the video!! I want to show last 12 months from the last month of multiple months selected in slicer. I have faced an issue that the trend shows only selected months irrespective of last 12 months. Can you please help how to achieve this?
@BIGorilla
@BIGorilla 3 жыл бұрын
Hi! The methods shown only adjust the calculated values. But not the months on the x axis. For that you need a different approach. Check out kzbin.info/www/bejne/rX2zp4ynbZeHhJY
@mohanr9522
@mohanr9522 3 жыл бұрын
@@BIGorilla Thanks for your reply Rick... So in this case I need another calendar table to show last 12 months from selected months.
@BIGorilla
@BIGorilla 3 жыл бұрын
@@mohanr9522 yes. And I published this before I knew about a better solution. If you're comfortable with complex code also have a look at www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/ I use this nowadays! Cheers Rick
@mohanr9522
@mohanr9522 3 жыл бұрын
@@BIGorilla Thanks Rick!!!
@omarsardar387
@omarsardar387 Жыл бұрын
Please share the PBIX file for same.
@krishj8011
@krishj8011 11 ай бұрын
great tutorial
@ranjeetkarande4917
@ranjeetkarande4917 2 жыл бұрын
hello sir , it really helpful video, can you please explain how to create Indexing - for month - Please Please create such video
@JohnKpl
@JohnKpl Жыл бұрын
Which measure is the fastest?
@BIGorilla
@BIGorilla Жыл бұрын
Hi John, that's a good question. The answer is, it depends on the model. Only testing the code using DAX studio will give the definite answer. You can record the timing of each query. When you include the measure it should give you a good idea !
@ankitsharma1943
@ankitsharma1943 10 ай бұрын
why we have added +1 in edate function
@jazzista1967
@jazzista1967 3 жыл бұрын
Rick: here is another approach but maybe it is too verbose . I am suing the next day function with datesbetween. Version number 3 in your example is very elegant with the used of variables. Now, How do you create a index month column in your date table? That was incredible. Thanks for sharing. CALCULATE ( [Total Sales], DATESBETWEEN ( 'Calendar'[Date], NEXTDAY ( SAMEPERIODLASTYEAR ( LASTDATE ( 'Calendar'[Date] ) ) ), LASTDATE ( 'Calendar'[Date] ) ) )
@BIGorilla
@BIGorilla 3 жыл бұрын
Hey Jazzista, Seems like a great approach! The use of the variables is optional. It only makes things easier to read. But if you prefer doing it without and it doesn't get overwhelming, please do so 😁 The index column I've added in Power Query using the 'Add Index column' . However, it's important to add the index column on the right level in the hierarchy. So when the data is grouped on Month level. Keep looking out for the next released video. Coming week I will release a video on adding index columns at the right level of the hierarchy. It may point you in the right direction. Rick
@jazzista1967
@jazzista1967 3 жыл бұрын
Thanks Rick. Look forward to that video. Thanks for replying.
@BIGorilla
@BIGorilla 3 жыл бұрын
@@jazzista1967 You can find the video I mentioned right here: kzbin.info/www/bejne/fpSWlWuogriLmbM Hope that helps :)
@jhazielpetersen761
@jhazielpetersen761 2 жыл бұрын
how about last ? weeks e.g. last 10 weeks, last 12 weeks etc.?
@user-ls5kl7my2t
@user-ls5kl7my2t 3 ай бұрын
How to provide data for last 12 months excluding the months that does not have data
@sravankumar1767
@sravankumar1767 3 жыл бұрын
if it is last month Sales why the values are cummulating like 469824+43421=513245, can u clarify my doubt
@BIGorilla
@BIGorilla 3 жыл бұрын
Each month shows the sales for only that particular month. But the idea behind this trick is that it shows the last 12 months on the axis of the graph. It's not so much about the calculation in each month, but more the months shown on the axis. Does that help?
@rcarranzamanuel
@rcarranzamanuel 2 жыл бұрын
How not to show those month with no data?
@salidandigopi4358
@salidandigopi4358 3 жыл бұрын
Your screen is not visible proaparly, Plase keep it visible , tq
@BIGorilla
@BIGorilla 3 жыл бұрын
Hi! Thanks for the feedback. In which part do you have trouble seeing the screen?
@salidandigopi4358
@salidandigopi4358 3 жыл бұрын
@@BIGorilla I got first way , but reamaing ways I couldn't see it exactly
@BIGorilla
@BIGorilla 3 жыл бұрын
@@salidandigopi4358 I'm sorry to hear that. Please check if you're watching with the highest quality. Are you perhaps watching on a phone. It looks sharp on my end. ^^Rick
@salidandigopi4358
@salidandigopi4358 3 жыл бұрын
@@BIGorilla tq , I can see now clearly ,
@valentinaguffanti
@valentinaguffanti 2 жыл бұрын
¡Thanks!
@julie_chen
@julie_chen 5 ай бұрын
🙏🙏🙏
@vasudevpatil2309
@vasudevpatil2309 3 жыл бұрын
I am facing one challenge where I wanted to show the Current month value than Previous month value and then % change between these for multiple categorical variables, in columns in Table/Matrix visualization. The data is of fund valuation. and across different categories across the last 5 years. I could get the last 2 months values using measure suggested above but then when I tried to get the % change in visual, it appeared for both of the months side by side and not after the 2 columns. I Want to create visuals like below e.g. Fund Category||Fund name||Nov2021||Oct2021||%change Next month it would automatically change to Fund Category||Fund name||Dec2021||Nov2021||%change
Show last 13 Months from Slicer Selection in Power BI (DAX)
9:49
Power BI DAX: Time Intelligence Rolling Measures (Tutorial) 💥
17:04
Pragmatic Works
Рет қаралды 25 М.
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
3 Ways to use Calculation Groups You Need to Know
20:00
How to Power BI
Рет қаралды 84 М.
Computing rolling average in DAX
16:43
SQLBI
Рет қаралды 75 М.
Calculate Growth over Last Year by Fiscal Year in Power BI
18:00
Scenario: ROLLING 12 MONTHS Average Sales | Power BI Interview
6:48
DAX Made Easy | Rolling 12 Month Total | Power BI for Beginners
10:41
The Data Analyst Training Hub
Рет қаралды 3,4 М.
Show last 6 months based on user single slicer selection
20:04
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 259 М.
Convert Dates to Fiscal Periods with Power Query - Better than Formulas!
13:01
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН