Show MTD, QTD & YTD Calculations To Current Date in Power BI w/DAX

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

Komentáře • 69

  • @EnterpriseDNA
    @EnterpriseDNA  Před 4 lety

    ***** Related Links *****
    Prevent YTD, QTD, MTD Results Extending Forward In Power BI
    blog.enterprisedna.co/prevent-ytd-qtd-mtd-results-projecting-forward-dax-techniques-in-power-bi/
    Time Comparison For Non Standard Date Tables In Power BI
    blog.enterprisedna.co/compare-time-periods-with-non-standard-date-tables-dax-and-power-bi/
    Calculate Financial Year To Date (FYTD) Sales In Power BI Using DAX
    blog.enterprisedna.co/learn-how-to-calculate-sales-financial-year-to-date/
    ***** Related Course Modules *****
    Time Intelligence Calculations
    portal.enterprisedna.co/p/advanced-analytics
    DAX Formula Deep Dives
    portal.enterprisedna.co/p/dax-formula-deep-dives
    Mastering DAX Calculations
    portal.enterprisedna.co/p/mastering-dax-calculations
    ***** Related Support Forums *****
    MTD & MTD LY Calculation
    forum.enterprisedna.co/t/mtd-mtd-ly-calculation/1152
    Prevent YTD, QTD, MTD Results Projecting Forward - DAX Techniques
    forum.enterprisedna.co/t/prevent-ytd-qtd-mtd-results-projecting-forward-dax-techniques/311
    Building Relationship Between Data Model
    forum.enterprisedna.co/t/building-relationship-between-data-model/424
    For more MTD, QTD & YTD queries to review see here…..
    forum.enterprisedna.co/search?q=MTD%2C%20QTD%20%26%20YTD

  • @petehamilton705
    @petehamilton705 Před 6 lety +9

    I have been trying to figure out how to do the YTD to current date all day. I should have started looking here! Awesome stuff Sam, thanks.

  • @Phil-hz8rc
    @Phil-hz8rc Před 3 lety

    You are without a doubt the best resource I have come across for learning Power BI, thank you so much.

  • @gerensp
    @gerensp Před 6 lety +2

    Thank you so much... helped me over a huge obstacle on a pattern I rely on everyday.

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

    Kandungan video sangat baik, tahniah

    • @EnterpriseDNA
      @EnterpriseDNA  Před 2 lety

      Hi Enrique, glad that you appreciated our content! If you haven't yet, you can subscribe to our channel to see all our upcoming Power BI and Power Platform video tutorials and announcements. Cheers!

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

    Hi Sam, thanks for the video, though i have a simple problem. How do I get total sum of sales till date in the same column.
    I have compared sales for month of May this year till date to total sales for month may last year till date which is working fine but i also need to sum those total sales. In my case power bi auto sums the last year may total sales but i need the sum to only till date.

  • @hi_vishy
    @hi_vishy Před 6 lety +1

    Really Superb

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

    Perfect

  • @junminwu9380
    @junminwu9380 Před 6 lety +4

    Sam, what if I need the table to show total value(both This year and Last year )? Thank you.

    • @alexpetkunas9669
      @alexpetkunas9669 Před rokem

      Did you get an answer to this? Basically I have a month slicer, so if one month is chosen, I want it to show the previous year value (summed up) through the current day in the month for the current year and the past year. The reason for this is that my table doesn't show each day. Instead, it has the sales person and their respective sales numbers. However, when I do what Sam suggests in the video, my values end up showing up as 0 when filtering for the current month. However, it works fine when filtering for last month. I feel like I'm close, but I haven't figured out a way to quite get over this obstacle.

  • @thecreative100
    @thecreative100 Před 6 lety +2

    Thanks a ton! You saved my day :)

  • @FalconFlyer75
    @FalconFlyer75 Před 3 lety

    this is pretty close to what i'm looking for but what do I do if it's not TODAY() I'm Looking for, example lets say i'm working with a range of dates
    Dec 1 - Dec 12th (that's what's in my slicer), now I want the MTD compared to just the 12th of December
    and I want to be able to do that even if i'm running the report on the 14th of December

  • @ashwinfrancis7567
    @ashwinfrancis7567 Před 2 lety

    Hi Sam,
    Thank you for this video, I found it quite helpful
    If I wanted to extend this logic on an MTD basis to all the previous months in the year, would you have any suggestions on doing this?

    • @EnterpriseDNA
      @EnterpriseDNA  Před rokem

      Hello Ashwin Francis,
      Thank You for posting your query onto our channel. We really appreciate you taking your valuable time to post it.
      Alongwith MTD, you can also implement the logic of "DATEADD()" function inside your measure in order to analyse the previous months. We're providing few of the links of the articles from our blog posts as well as links of the videos from our Enterprise DNA CZcams channel pertaining to the "DATEADD()" topic.
      For furthermore queries, you can also reach out to us onto our Community Forum where our members as well as experts team will be able to assist you in a better and efficient manner. Below is the link of the forum provided for the reference as well.
      Hoping you find this useful! You can subscribe to our CZcams channel so that you won't miss out on any Power BI updates. You can also join our LinkedIn group to receive latest updates on Power BI.
      Cheers,
      Enterprise DNA
      forum.enterprisedna.co/
      czcams.com/channels/y2rBgj4M1tzK-urTZ28zcA.html
      www.linkedin.com/groups/12004506/
      blog.enterprisedna.co/power-bi-dateadd-function-time-related-insights/
      blog.enterprisedna.co/power-bi-time-functions-dateadd-and-more/
      community.powerbi.com/t5/Community-Blog/Power-BI-Time-Intelligence-Functions-Why-DATEADD-Is-The-Best/ba-p/1815611
      czcams.com/video/pioJAenHEMg/video.html
      czcams.com/video/1P99rg9a6es/video.html

  • @PeachBeef
    @PeachBeef Před 4 lety

    last step to blank the days to come is not working properly for me. If the last day of my data set is 1/7/2020 for instance, days 1-6 are perfect and then the final day of the PY volume just reports the final 2019 Jan value.

  • @matinqaiser4658
    @matinqaiser4658 Před 6 lety

    Great video, which has helped me understand how YTD in PowerBI works. I have a specific YTD problem I simply cannot solve: I have YTD measure calculated as in your example. However, I want this YTD measure to always include the data from start of current year until the last date in the filter selection. For instance: if some month slicer is set to July, the YTD measure should then consider all data from January till end of July. Which DAX operators are necessary for this kind of requirement?

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety +1

      The YTD formula should do exactly what you actually need, so I'm not sure you need to use anything different. Regardless of the slicer selection it will always start from January

  • @jithiljohn2961
    @jithiljohn2961 Před 5 lety

    Please help, I want to YTD and MTD in matrix based on the document type totals namely - net sales, order entry and order in hand. But order in hand we have to calculate. Order in hand = order entry - net sales. Order entry and net sales directly available from the table.

  • @stephenbrincat7124
    @stephenbrincat7124 Před 5 lety

    Hi Sam, thanks for your great videos, thanks to your help I manged to figure out this formula TOTALQTD(SUM(Coffee[Turnover]),DATEADD(FILTER(DATESYTD(dDate[Date]),dDate[Date]

  • @erickknackstedt3131
    @erickknackstedt3131 Před 6 lety

    Just what I was looking for, if it alters the total for LY as well. Love your content BTW, thank you!

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      That's great, chrs

    • @erickknackstedt3131
      @erickknackstedt3131 Před 6 lety

      FYI your prescribed syntax you return a blank at the grand total. I've found that the following syntax works just fine:
      YTD RN SPLY by BD = Var ReferenceDate =
      CALCULATETABLE(
      LASTDATE(DateBooking[Date]),
      'Fact Table')
      return
      CALCULATE (
      [YTD RN by BD],
      SAMEPERIODLASTYEAR ( DateBooking[Date]),SAMEPERIODLASTYEAR(ReferenceDate))

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      Nice one, thanks for sharing

  • @venkateshthammisetty7845

    Hi Sir, is it possible to give year end date dynamically in TotalYTD DAX instead of fixed like(4/30), so can u pls help me with this if there is a way

  • @saikumarchebrolu1071
    @saikumarchebrolu1071 Před 4 lety

    is that possible without having a date table in our model?

  • @frankkoopmans4980
    @frankkoopmans4980 Před 6 lety

    Nice post. Just wondering why not use sameperiodlastyear and also use datesqtd datesmtd and datesytd to calculate sales last year. I use that and works great.

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      Sure you absolutely can, there's is no difference to the ultimate result. Chrs

  • @ksimonchung
    @ksimonchung Před 4 lety

    Hi Sam did you build out the Dates table using Dax ? Or did you import it from a relational database?

  • @EricTrott
    @EricTrott Před 6 lety +1

    Great stuff indeed Sam! Thanks a lot!

  • @gerensp
    @gerensp Před 6 lety

    Sam, What if you wanted a specific date rather than using TODAY()? This is adding more dates than my current Year YTD value... Thanks

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      Use the DATE function and you can input specific dates that way

  • @kamalhossain5794
    @kamalhossain5794 Před 6 lety

    GREAT ----THANKS A LOT

  • @abdulrahmanmajeed9957
    @abdulrahmanmajeed9957 Před 2 lety

    I tried apply previous QTD on a card visual but it is giving me blank. Can you pls suggest how to fix previous QTD in a card visual?

    • @EnterpriseDNA
      @EnterpriseDNA  Před 2 lety

      Hello Abdul,
      Thank you for posting your query onto our channel. We really appreciate you taking your valuable time to post.
      Well, the reason why it might be showing the result as a "BLANK" is because in the case of card visual one might be required to provide the external context to it i.e. date filter in any form. If you haven't selected any date filter or don't have any date filters on your page then it'll not be able to recognize for which period it needs to evaluate the results.
      For furthermore queries, you can also reach out to us onto our Enterprise DNA Community Forum where our members as well as experts team will be able to assist you in a better and efficient manner.
      Hoping you find this useful. Also, make sure that you're subscribed to our CZcams channel so that you don't miss out on any updates pertaining to the Power BI. You can also join our Power BI group on LinkedIn to receive latest updates on Power BI. Below are the links provided for the reference purposes.
      Cheers,
      Enterprise DNA
      forum.enterprisedna.co/
      czcams.com/users/EnterpriseDNA
      www.linkedin.com/groups/12004506/

  • @lovemoregumbo8544
    @lovemoregumbo8544 Před 5 lety

    can you do MTD, QTD and YTD for budgets that are set on monthly basis

    • @EnterpriseDNA
      @EnterpriseDNA  Před 5 lety

      Hi Jenifer, see here for some ideas on this - forum.enterprisedna.co/search?expanded=true&q=MTD%2C%20QTD%20and%20YTD

  • @vida1719
    @vida1719 Před 6 lety

    Great as always

  • @tonyz1616
    @tonyz1616 Před 5 lety

    Hi Sam, at 4:23 where you adding IF(LASTDATE(Dates[date]) > TODAY(), BLANK(), ……..) I wondering if I using the same measure to other visualization like Column chart and just throw the 2 measures : Total Sales YTD & Total Sales PY YTD, without any Dates dimension, will it show any value ?
    Thanks, love your videos

    • @EnterpriseDNA
      @EnterpriseDNA  Před 5 lety

      For help like this check out the Enterprise DNA Support Forum - forum.enterprisedna.co/

  • @sureshramesh3471
    @sureshramesh3471 Před 3 lety

    I have a date slicer which should show last 12 months as selected when report opens. Further, user should have flexibility to select any other date range. Please any one answer this question

    • @EnterpriseDNA
      @EnterpriseDNA  Před 3 lety

      Hello suresh ramesh,
      thank You for posting your query onto our channel.
      We're providing a link below where similar sort of queries were asked onto our Community Forum by our members and of our expert wrote a M Code to resolve similar sort of query. Below is the link provided for the reference where you can view the query as well as the solution provided and also you can download the solution file provided within that link.
      If you've any more questions than please reach out to us onto our Community Forum where our members as well as experts team will be able to assist you in a better and efficient manner. We're also providing the link of our Community Forum for the reference.
      Hoping you find this useful and meets your requirements that you've been looking for.🙂
      Happy Learning!!!
      forum.enterprisedna.co/t/rolling-graph-with-fixed-number-of-period/12255
      forum.enterprisedna.co/

  • @RajaParivlog
    @RajaParivlog Před 5 lety

    Please let me know if I select the QTR 3 and then data should reflect from QTR to QTR3. Could you please help on this

  • @mohshalsh5965
    @mohshalsh5965 Před 2 lety

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

    • @EnterpriseDNA
      @EnterpriseDNA  Před 2 lety

      Hi Moh,
      Thank you for posting your query onto our channel. We really appreciate you taking your valuable time to post it.
      The query which you've posted is not clear to us. We request you to please elaborate your scenario and the results that you're trying to visualize or achieve so that we can assist you.
      For furthermore queries, you can also reach out to us onto our Community Forum where our members as well as experts team will be able to assist you in a better and efficient manner. Below is the link of the forum provided for the reference as well.
      Hoping you find this useful. Subscribe to our CZcams channel so that you don't miss out on any updates pertaining to the Power BI. You can also join our Power BI group on LinkedIn to receive latest updates on Power BI.
      Cheers,
      Enterprise DNA
      forum.enterprisedna.co/
      czcams.com/channels/y2rBgj4M1tzK-urTZ28zcA.html
      www.linkedin.com/groups/12004506/

  • @ShivamYadav-ib8hg
    @ShivamYadav-ib8hg Před 2 lety

    Is this any video for this with current financial year ytd and lytd

    • @EnterpriseDNA
      @EnterpriseDNA  Před 2 lety

      Hello Shivam Yadav,
      Thank you for posting your query onto our channel.
      Well, it's an easy solution if you want to compare Current Financial YTD V/s LYTD. We're providing the generalized measures below for the reference which you can modify it as per your requirements.
      CYTD =
      CALCULATE( [Total Sales] ,
      DATESYTD( Dates[Date] , "31/3" ) )
      LYTD =
      CALCULATE( [CYTD] ,
      DATEADD( Dates[Date] , -1 , YEAR ) )
      We're providing few of the links of the articles from our blog posts as well as links of the videos from our Enterprise DNA CZcams channel pertaining to this topic.
      For furthermore queries, you can also reach out to us onto our Community Forum where our members as well as experts team will be able to assist you in a better and efficient manner. Below is the link of the forum provided for the reference as well.
      Hoping you find this useful and helpful. Also, make sure that you're subscribed to our CZcams channel so that you don't miss out on any updates pertaining to the Power BI. You can also join our Power BI group on LinkedIn to receive latest updates on Power BI. Below are the links provided for the reference purposes.
      Cheers,
      Enterprise DNA
      forum.enterprisedna.co/
      czcams.com/channels/y2rBgj4M1tzK-urTZ28zcA.html
      www.linkedin.com/groups/12004506/
      blog.enterprisedna.co/power-bi-financial-year-to-date-calculations/
      blog.enterprisedna.co/learn-how-to-calculate-sales-financial-year-to-date/
      czcams.com/video/RXfXM-KEbcg/video.html
      czcams.com/video/nrjJuNbzKRA/video.html
      czcams.com/video/JNt-_QByeLk/video.html
      czcams.com/video/EpfNfcBS3ZE/video.html

    • @ShivamYadav-ib8hg
      @ShivamYadav-ib8hg Před 2 lety

      @@EnterpriseDNA Tysm for your reply but what i want is i have live data
      1) My fiscal year start from 1st april
      Soo for example current date is 21 October 2021.......so financial YTD will be from 1st April till yesterday i.e. 20th of oct
      2) So my fiscal LYTD should be from 1st April 2020 till 20th October 2020........like true fiscal LYTD also i want same with fiscal MTD and QTD i searched all your videos and i don't think you have uploaded videos on this

  • @ashitoshshinde249
    @ashitoshshinde249 Před 4 lety

    Hi sir, I have been trying to understand the YTD vs LY YTD function. I am imitating all the formulas as per your video still my ans is mismatched with yours. does page level filter and report level filter are important to get the same ans ? sir can you (or anyone else) share your file with me since I have been trying to figure it out from last one week since I am not even getting relevant video for the same on the youtube.

  • @pinkilihitkar8093
    @pinkilihitkar8093 Před 3 lety

    I am trying to calculate YTD for timestamp_purchase_date it's throwing me an error timestamp_purchase_date contains duplicate dates..how can I calculate .plz let me the solution

    • @EnterpriseDNA
      @EnterpriseDNA  Před 3 lety

      Hello Pinki Lihitkar,
      thank You for posting your query onto our channel.
      Well, since you're trying to calculate the YTD it involves the time intelligence functions. And in order to calculate such results firstly you need to convert your timestamp dates into the normal date table and then try to calculate the YTD results.
      To work with Data Analysis Expressions (DAX) time intelligence functions, there’s a prerequisite model requirement: You must have at least one date table in your model. A date table is a table that meets the following requirements: -
      It must have a column of data type date (or date/time )-known as the date column .
      The date column must contain unique values.
      The date column must not contain BLANKs.
      The date column must not have any missing dates.
      The date column must span full years. A year isn’t necessarily a calendar year (January-December).
      The date table must be marked as a date table .
      Now we couldn’t provide a proper Date dimension table because we don’t know the specific requirements in your case. We're providing a link below from where you can copy the M code of the date table which was created by one of our own expert which provides all the unique features which one ideal date table should have.
      For furthermore queries, you can write to us onto our community forum where our members as well as experts team will be able to assist you in a better and efficient manner. Below is also the link provided of our forum as well for the reference.
      Hoping you find this useful and helps you in achieving the desired results that you've been looking for.🙂
      Happy Learning!!!
      Thanks and Warm Regards,
      Enterprise DNA
      forum.enterprisedna.co/t/extended-date-table-power-query-m-function/6390
      forum.enterprisedna.co/

  • @wajdimatoussi
    @wajdimatoussi Před 5 lety

    Hi all
    Is there any formula for Half To date ? For one semester cumulative dynamic total
    Thanks

    • @EnterpriseDNA
      @EnterpriseDNA  Před 5 lety

      Hi Wajdi, see here for some ideas on this - forum.enterprisedna.co/search?q=half%20date

  • @juanjomorenom
    @juanjomorenom Před 6 lety

    When i filter the year "SALES PY QTD" wont give me any results, but when i dont apply any filters it gives me all years from 2012 to 2018. do you know what it could be? thank you.

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      Not sure how you are filtering this sorry. First thing is always to check your relationship are correct. That is usually the problem.

  • @Pranav-fg5jr
    @Pranav-fg5jr Před 6 lety

    Hi, I want to calculate year to date of total email deliver from current date but my dimdate table have date records till 2024. So can you please suggest me any way to calculate YTD from current date

    • @EnterpriseDNA
      @EnterpriseDNA  Před 5 lety

      Why can't you just use YTD function? Make sure to use the filter fields so that you can filter out all irrelevant dates from your reports. See here to learn more about these - czcams.com/video/4ODf0XDgNbo/video.html

    • @Lewisgnistra
      @Lewisgnistra Před 5 lety

      @@EnterpriseDNA
      Thank you for a great video.
      However, what if the fiscal date starts from March? Calculating from January will be wrong then

  • @davidgodri3982
    @davidgodri3982 Před 6 lety

    Hi Sam, thanks for another great video. Do you have any advice for when you have many measures that you wish to convert to MTD, QTD, YTD, LY MTD, LY QTD, LY YTD, etc. ? It seems that if I start with 10 measures (total revenue, net revenue, labor, expenses, etc. ) and need a measure for each of those time horizons I now need to create 60 measures which becomes very challenging to maintain. Any thoughts? In excel its quick to drag-down and find/replace, but needing to edit each measure individually in PowerBI is very time consuming - curious if I'm missing something. Thanks!

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      I think you just have to create the individual measure there. The key would be to name these very well and also sort these well within measure tables. I think that having them all separate gives you good flexibility to use in many different ways. Once you have these setup once, it's really a copy and paste so shouldn't take too long to create these, just make sure to re-use the patterns for each one.

    • @davidgodri3982
      @davidgodri3982 Před 6 lety

      Thanks Sam, appreciate the quick reply. I can't wait till we can just copy-paste several measures once. : )

    • @davidgodri3982
      @davidgodri3982 Před 6 lety

      Hi Sam, when you have a moment, can you take a look at the idea I posted to the PowerBI forums?:
      ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/32863513-measure-management-dax-editor
      I think it would help solve many of our pain-points with editing large PowerBI models that contain 50+ measures as well as being able to quickly copy all measures from one PBIX file to another.

  • @FernandoThivanka
    @FernandoThivanka Před 6 lety

    Hi, great video! I have a question regarding MTD calculations and wondering if someone could help.
    My dates table has future dates and as a result, all the MTD,YTD calculations for previous years returns results for the entire month instead till the current date. Any idea how to fix this? Thanks in advance.

    • @EnterpriseDNA
      @EnterpriseDNA  Před 5 lety

      See here for how to do this - czcams.com/video/zYIxukD2KCM/video.html

    • @BlaineDeLuca
      @BlaineDeLuca Před 3 lety

      @@EnterpriseDNA i recreated the line graph, and that worked perfectly (thanks as always!). suppose I wanted to show the the MTD value and PY MTD in a card as well. I was able to get current year with no issue. However, I can't seem to figure it out for the previous year (the best I can get is the full month for the previous year....rather than actual MTD).

  • @TheYteds
    @TheYteds Před 6 lety

    Great information, where is the download with the formulas? Thanks

    • @EnterpriseDNA
      @EnterpriseDNA  Před 6 lety

      Please review description for Enterprise DNA resources - requires small investment. Thanks

    • @rrrprogram8667
      @rrrprogram8667 Před 6 lety

      Thanks... Good one

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

    I guess I’m the only idiot here because the presenter is extremely too fast for my tiny brain to follow… I’ll look elsewhere
    😐