skip to main content
Power BI
    • What is Power BI
    • Why Power BI
    • Customer stories
    • Data visuals
    • Security
    • Power BI Desktop
    • Power BI Pro
    • Power BI Premium
    • Power BI Mobile
    • Power BI Embedded
    • Power BI Report Server
  • Pricing
    • Azure + Power BI
    • Microsoft 365 + Power BI
    • Dynamics 365 + Power BI
      • Energy
      • Healthcare
      • Manufacturing
      • Media
      • Retail
    • For analysts
    • For IT
      • Overview
      • Embedded analytics
      • Power BI visuals
      • Automation
      • Documentation
      • Community
    • Overview
    • Find consulting services
    • Partner showcase
    • Find a partner
    • Become a partner
    • Instructor-led training
    • Getting started
      • Overview
      • Self-guided learning
      • Webinars
      • Documentation
      • Roadmap
      • Overview
      • Issues
      • Give feedback
    • Blog
    • Business intelligence topics
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Events
    • User groups
    • Community blog
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Microsoft Power BI Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power BI
    • Desktop
    • Service
    • Report Server
    • Power Query
    • Mobile Apps
    • Developer
    • DAX Commands and Tips
    • Custom Visuals Development Discussion
    • Health and Life Sciences
    • Power BI Spanish Community
    • Translated Spanish Desktop
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Training and Consulting
    • Instructor Led Training
    • Galleries
    • Community Connections & How-To Videos
    • COVID-19 Data Stories Gallery
    • Themes Gallery
    • Data Stories Gallery
    • R Script Showcase
    • Webinars and Video Gallery
    • Quick Measures Gallery
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Events
    • Ideas
    • Custom Visuals Ideas
    • Issues
    • Issues
    • Events
    • Upcoming Events
    • Community Engagement
    • T-Shirt Design Challenge 2023
    • Community Blog
    • Power BI Community Blog
    • Custom Visuals Community Blog
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power BI Community
    • Galleries
    • Quick Measures Gallery
    • Time Intelligence "The Hard Way" (TITHW)

    Time Intelligence "The Hard Way" (TITHW)

    06-06-2018 12:53 PM - last edited 06-06-2018 14:29 PM

    Super User Greg_Deckler
    Super User
    83215 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Time Intelligence "The Hard Way" (TITHW)

    ‎06-06-2018 12:53 PM

    The Time intelligence features of Power BI are fantastic. But, let's be honest, they can also be a little frustating at times, have certain limitations and require data that actually has, well, dates, for one thing in addition to a separate Date/Calendar dimension table. And, let's further face the facts that we don't always have things like actual dates, sometimes we only have data like Year and Month or Year and Quarter. 

     

    This Quick Measure presents some options for doing some common Time Intelligence measures "the hard way" so to speak. Essentially solving time intelligence issues with non-time intelligence DAX functions. While only a few measures are presented, generally around year and month, just about any time intelligence issue can be solved through the basic technique presented here.

     

    Three measures are presented for Total Year to Date, Total Last Year to Date and % Change Year over Year. Here they are:

     

     

    TITHW_TotalYTDHW = 
    VAR __MaxYear = MAX('Years'[Year])
    VAR __MaxMonth = MAX('Months'[MonthSort])
    VAR __TmpTable = CALCULATETABLE('TheHardWay',ALL('Years'[Year]),All('Months'[Month]))
    RETURN SUMX(FILTER(__TmpTable,[Year]=__MaxYear && [MonthSort] <= __MaxMonth),[Value])
    
    
    TITHW_TotalLYTDHW = 
    VAR __MaxYear = MAX('Years'[Year])
    VAR __MaxMonth = MAX('Months'[MonthSort])
    VAR __TmpTable = CALCULATETABLE('TheHardWay',ALL('Years'[Year]),All('Months'[Month]))
    RETURN SUMX(FILTER(__TmpTable,[Year]=__MaxYear-1 && [MonthSort] <= __MaxMonth),[Value])
    
    
    TITHW_%ChangeYoY = 
    VAR __MaxYear = MAX('Years'[Year])
    VAR __MaxMonth = MAX('Months'[MonthSort])
    VAR __TmpTable = CALCULATETABLE('TheHardWay',ALL('Years'[Year]),All('Months'[Month]))
    VAR __currentYear = SUMX(FILTER(__TmpTable,[Year]=__MaxYear && [MonthSort] <= __MaxMonth),[Value])
    VAR __previousYear = SUMX(FILTER(__TmpTable,[Year]=__MaxYear - 1 && [MonthSort] <= __MaxMonth),[Value])
    RETURN DIVIDE(__currentYear - __previousYear,__previousYear,0)

    Now, this PBIX file uses separate Year and Month tables but those are not necessary, this was done to make comparing the time intelligence functions and the non-time intelligence way of doing things easier to compare. 

     

     

     

     

     

     

    eyJrIjoiNjUzODY3NGYtNTY2NC00YTFjLTkxMjAtNDFjMWVmN2Q4OGQ1IiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Preview file
    113 KB
    TimeIntelligenceTheHardWay.pbix
    Labels:
    • Labels:
    • Time Intelligence
    Message 1 of 21
    83,215 Views
    13
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    daniel_baciu
    daniel_baciu Helper I
    Helper I
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-18-2023 02:42 AM

    Using your data model, i tried to create a line chart/matrix where to show last year YTD for every period, and current year YTD until month of June for example. 

    The existing measures cannot provide this, so may i kindly ask you to provide a solution to this? 

    Result is shown below and pbix is here.

    Preview file
    8 KB
    Message 21 of 21
    789 Views
    0
    Reply
    learning_dax
    learning_dax Helper II
    Helper II
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎02-09-2022 10:12 PM

    Hi @Greg_Deckler,

    Diving into all of your posts thanks for the time & effort. I'm just having a hard time implementing your "Hard Way" formulas, and I cannot seem to get Power BI's normal TI to work. Can you explain what some of the entries mean in your "Hard Way" formulas like [Year] [Month Sort] and why in CALCULATETABLE calculation it is ALL('Months'[Month]) instead of in a previous variable 'Months'[MonthSort]? I'd like to just understand these formulas a bit better so that I can implement them the hard way. 

     

    Thank you

    Message 19 of 21
    19,764 Views
    0
    Reply
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    In response to learning_dax
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎02-10-2022 06:59 AM

    @learning_dax Sure, those are columns. Download the attached PBIX file just below the signature on the original post to understand what is going on. The ALL() is removing the filter on Month since you need to break out of filter context of the visual to include previous months for example.


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Message 20 of 21
    19,734 Views
    0
    Reply
    abristow
    abristow
    Frequent Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎05-10-2021 02:32 PM

    @Greg_Deckler question for you on this: What adjustments would I need to make so that I can dynamically visualize weekly data as a trend on a bar chart vs summing the desired # of weeks?

     

    Context: 

    One of my data sources pushes updates each week with a number of pre-aggrigated time period sums. They appear in a slicer like this:

    time periods.png

     

     

     

     

     

     

     

    I also recieve sums for individual weeks and visualize them as a trend like this:

    weekly trend.png

     

     

     

     

     

     

    I am looking for a way to have the weekly trend visual update based on the number of weeks referenced in my slicer selection. 

     

    I created this measure using your THW method but it's giving me a single sum of 1, 4, 13 weeks, etc.:

     

    Weekly Trend_Test = 
    VAR PeriodDescriptionSelected = SELECTEDVALUE ( 'date'[Period Description] )
    VAR NumOfCharacters = LEN ( PeriodDescriptionSelected ) 
    VAR WeeksToDisplay = 
    IF (
        NumOfCharacters = 27, // <-- Latest # wks
        MID ( PeriodDescriptionSelected, 8, 1 ),
        IF (
            NumOfCharacters = 28, // <-- Latest ## wks
            MID ( PeriodDescriptionSelected, 8, 2 ),
            IF (
                NumOfCharacters = 20, // <-- YTD # w/e
                MID ( PeriodDescriptionSelected, 7, 1 ),
                IF (
                    NumOfCharacters = 21, // <-- YTD ## w/e
                    MID ( PeriodDescriptionSelected, 7, 2 ),
                    IF (
                        NumOfCharacters = 26, // <-- Latest 1 wk
                        MID ( PeriodDescriptionSelected, 8, 1 )
                    )
                )
            )
        )
    )
    VAR MaxPeriodEndingDate = MAX ( 'date'[Period Ending Date] )
    VAR FirstPeriodEndingDate = MaxPeriodEndingDate - ( WeeksToDisplay * 7 )
    VAR _TmpTable = 
    CALCULATETABLE (
        'fact scan data',
        ALL ( 'date'[Period Ending Date] )
    )
    
    RETURN
    SUMX (
        FILTER (
            _TmpTable,
            [Period Ending Date] >= FirstPeriodEndingDate
            && [Period Ending Date] <= MaxPeriodEndingDate
        ),
        [VALUE]
    )

     

    Any guidance you can provide would be greatly appreciated! 

    Message 17 of 21
    37,218 Views
    0
    Reply
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    In response to abristow
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎05-13-2021 07:20 PM

    @abristow Hmm, without seeing sample data, perhaps try this (below). Does your fact_scan_data table have a Period Ending Date column?

    Weekly Trend_Test = 
    VAR PeriodDescriptionSelected = SELECTEDVALUE ( 'date'[Period Description] )
    VAR NumOfCharacters = LEN ( PeriodDescriptionSelected ) 
    VAR WeeksToDisplay = 
    IF (
        NumOfCharacters = 27, // <-- Latest # wks
        MID ( PeriodDescriptionSelected, 8, 1 ),
        IF (
            NumOfCharacters = 28, // <-- Latest ## wks
            MID ( PeriodDescriptionSelected, 8, 2 ),
            IF (
                NumOfCharacters = 20, // <-- YTD # w/e
                MID ( PeriodDescriptionSelected, 7, 1 ),
                IF (
                    NumOfCharacters = 21, // <-- YTD ## w/e
                    MID ( PeriodDescriptionSelected, 7, 2 ),
                    IF (
                        NumOfCharacters = 26, // <-- Latest 1 wk
                        MID ( PeriodDescriptionSelected, 8, 1 )
                    )
                )
            )
        )
    )
    VAR MaxPeriodEndingDate = MAX ( 'date'[Period Ending Date] )
    VAR FirstPeriodEndingDate = MaxPeriodEndingDate - ( WeeksToDisplay * 7 )
    RETURN
    SUMX (
        FILTER (
            ALL('fact scan data'),
            [Period Ending Date] >= FirstPeriodEndingDate
            && [Period Ending Date] <= MaxPeriodEndingDate
        ),
        [VALUE]
    )

     


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Message 18 of 21
    37,062 Views
    0
    Reply
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎02-19-2020 11:38 PM

    Great. Yipeee, That solved my issue. Thanks....

    Message 16 of 21
    45,222 Views
    0
    Reply
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎09-03-2019 09:34 AM

    YTD.png

    Can you please help on this. This is my MTD data. My requirement is to create YTD for the same with opening. Please go through my PBIX file

    Send.pbix
    Message 15 of 21
    45,503 Views
    0
    Reply
    charleshale
    charleshale Responsive Resident
    Responsive Resident
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎07-12-2019 06:45 AM

    How would you add a measure to show the $ amount of lost customers for any customer?

    Message 14 of 21
    45,653 Views
    0
    Reply
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎02-15-2019 05:33 AM

    Hi Greg,

     

    Thank you for your repsonse and I absoletly like it. However I need a dynamic month over month average with variance and percentage. I'm not sure how to apply your methodology to this.

     

    Tom

    Message 13 of 21
    45,891 Views
    0
    Reply
    MojoGene
    MojoGene Helper V
    Helper V
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-02-2019 08:18 AM

    Greg:

     

    I'll give it a try.

     

     

    Message 12 of 21
    45,933 Views
    0
    Reply
    Shelley
    Shelley Continued Contributor
    Continued Contributor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-13-2018 12:33 PM

    Hi Greg, I still really value your formulas; however, I'm running into some challenges in comparing actuals to plan.

     

    For example, let's say we're only one month into the new fiscal year, but we have the plan for the entire fiscal year loaded. In using this formula:


    VAR __MaxYear = MAX('RA_Daily_Calendar'[Fiscal_Year])
    VAR __MaxMonth = MAX('RA_Daily_Calendar'[Fiscal_Month])
    VAR __TmpTable = CALCULATETABLE('RA_Daily_Calendar',ALL('RA_Daily_Calendar'[Fiscal_Year]),All('RA_Daily_Calendar'[Fiscal_Month]))
    RETURN SUMX(FILTER(__TmpTable,[Fiscal_Year]=__MaxYear && [Fiscal_Month] <= __MaxMonth),
    'Goals-Order$'[Total Order $ Goal])

     

    It calculates the goal for the entire fiscal year, but I'm expecting/wanting only the goal for October.

     

    To account for this, I modified the expression to look at the max order date in the actuals, like this (because I want to compare current YTD actuals to the corresponding YTD plan).

     

    YTD Total Order $ Goal =
    VAR __MaxYear = (LOOKUPVALUE('RA_Daily_Calendar'[Fiscal_Year], 'RA_Daily_Calendar'[Date], MAX('OrdersView'[Line_Creation_Date])))
    VAR __MaxMonth = (LOOKUPVALUE('RA_Daily_Calendar'[Fiscal_Month], 'RA_Daily_Calendar'[Date], MAX('OrdersView'[Line_Creation_Date])))
    VAR __TmpTable = CALCULATETABLE('RA_Daily_Calendar',ALL('RA_Daily_Calendar'[Fiscal_Year]),All('RA_Daily_Calendar'[Fiscal_Month]))
    RETURN SUMX(FILTER(__TmpTable,[Fiscal_Year]=__MaxYear && [Fiscal_Month] <= __MaxMonth),
    'Goals-Order$'[Total Order $ Goal])

     

    In total, this formula structure seems to work properly. It is slick! However, I just discovered that when I try to drill into the actuals and goals down to finer levels of detail, like the product line, I run into issues. It appears that if there are no orders for this particular product yet this year, then it sees the latest date as being the last time there was an order for this product, which was last year, and does not sum the goals properly for this year.

     

    In trying to figure out how to resolve this, I'm a bit perplexed. I thought the statement below was looking at the maximum date for the entire data set, but instead it appears to filter down to the lower levels - which I guess is understandable. 
    VAR __MaxYear = (LOOKUPVALUE('RA_Daily_Calendar'[Fiscal_Year], 'RA_Daily_Calendar'[Date], MAX('OrdersView'[Line_Creation_Date])))

     

    However, how can I modify this so it looks at the maximum year and month for the entire actual orders dataset? I was trying the ALL function, but it doesn't work with MAX. What am I missing? Or is there something else I could do to address this issue?

     

    Thanks for any help you can provide. You've been great.

    Shelley

    Message 5 of 21
    81,741 Views
    0
    Reply
    Shelley
    Shelley Continued Contributor
    Continued Contributor
    In response to Shelley
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-13-2018 12:48 PM

    I think I finally got it! I finally figured out how to get ALL and MAX to work together -- CALCULATE(MAX('OrdersView'[Line_Creation_Date]), ALL('OrdersView'))) -- I have to check it some more, but I wanted to let you know I may have gotten it so you don't waste any time trying to help me. Thanks!

     

    YTD Total Order $ Goal =
    VAR __MaxYear = (LOOKUPVALUE('RA_Daily_Calendar'[Fiscal_Year], 'RA_Daily_Calendar'[Date], CALCULATE(MAX('OrdersView'[Line_Creation_Date]), ALL('OrdersView'))))
    VAR __MaxMonth = (LOOKUPVALUE('RA_Daily_Calendar'[Fiscal_Month], 'RA_Daily_Calendar'[Date], CALCULATE(MAX('OrdersView'[Line_Creation_Date]), ALL('OrdersView'))))
    VAR __TmpTable = CALCULATETABLE('RA_Daily_Calendar',ALL('RA_Daily_Calendar'[Fiscal_Year]),All('RA_Daily_Calendar'[Fiscal_Month]))
    RETURN SUMX(FILTER(__TmpTable,[Fiscal_Year]=__MaxYear && [Fiscal_Month] <= __MaxMonth),
    'Goals-Order$'[Total Order $ Goal])

    Message 6 of 21
    81,737 Views
    0
    Reply
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    In response to Shelley
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-13-2018 01:26 PM

    You should also be able to do MAXX(ALL('Table'),[Column])


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Message 7 of 21
    81,725 Views
    1
    Reply
    Shelley
    Shelley Continued Contributor
    Continued Contributor
    In response to Greg_Deckler
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎11-15-2018 08:59 AM

    I can't get the MAXX function to work, and I just discovered that using my solution above for the maximum line creation date, doesn't work when filtering to the prior year. Arg. I can't believe how difficult it is to get Power BI to work properly for YTD actuals and plan and filter as expected. 

     

    Message 8 of 21
    81,696 Views
    0
    Reply
    Anonymous
    Not applicable
    In response to Shelley
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎12-06-2018 05:17 AM

    Hi Greg,

    What would the formula look like to not just show the total year to date (7615 in your overview), but the liftime to date value, which can span across several years?

     

    Capture.PNG

     

    I have a report with a fiscal year and month filter where I want to see my total amount of outlets. This doesn't stop and start over when the year ends; in January it will need to continu counting the outlets, and I want to see the MoM result for January as well. If I would be using the FYTD calculation it will start over with counting as of January.

     

    Would you have some advice for this, or is this perhaps a metric that you could add to your report?

    Regards

    Bas

    Message 9 of 21
    81,418 Views
    0
    Reply
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    In response to Anonymous
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎12-06-2018 06:38 AM

    Hmm, if I understand what you are asking for then I am thinking something along the lines of:

     

    TITHW_TotalYTDHW = 
    VAR __MaxYear = MAX('Years'[Year])
    VAR __MaxMonth = MAX('Months'[MonthSort])
    VAR __TmpTable = CALCULATETABLE('TheHardWay',ALL('Years'[Year]),All('Months'[Month]))
    VAR __ThisYear = SUMX(FILTER(__TmpTable,[Year]=__MaxYear && [MonthSort] <= __MaxMonth),[Value])
    VAR __PreviousYears = SUMX(FILTER(__TmpTable,[Year]<__MaxYear),[Value])
    RETURN __ThisYear + __PreviousYears

    PC Load Letter. WTF does that mean?


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Message 10 of 21
    81,410 Views
    0
    Reply
    Anonymous
    Not applicable
    In response to Greg_Deckler
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎12-10-2018 07:31 AM

    Haha I had to look that quote up, but you're the first one who spotted the avatar pic 🙂

     

    I tried your suggestion but couldn't get it to fully work, and then landed on this calculation which did the trick for me:

     

    CALCULATE(
    SUM(calculation),
    DATESBETWEEN(_Date[Date], DATE(1901,1,1), LASTDATE(_Date[Date]) )
    )



    Thanks for getting me there!
    Bas

    Message 11 of 21
    45,953 Views
    0
    Reply
    st-dat
    st-dat Helper III
    Helper III
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎10-20-2018 03:50 PM

    Hello,

     

    Thank you for your help, I will try the 2 suggestions on YTD and PYTD and provide feedback later. 

     

    I will also appreciate your opinion on the 6 measures I posted for correction or guidance.

     

    Many thanks for your kindness.

    Message 4 of 21
    82,076 Views
    0
    Reply
    PeteSmith6730
    PeteSmith6730
    Frequent Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎07-28-2018 03:10 AM

    Nice reference to YTD etc, but still not solved my issues.

    Message 2 of 21
    82,766 Views
    0
    Reply
    Greg_Deckler
    Super User Greg_Deckler
    Super User
    In response to PeteSmith6730
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎07-28-2018 05:54 AM

    @PeteSmith6730 - And that problem is? Can you post a link to your original forums post?


    @ me in replies or I'll lose your thread!!!
    Instead of a Kudo, please vote for this idea
    Become an expert!: Enterprise DNA
    External Tools: MSHGQM
    YouTube Channel!: Microsoft Hates Greg
    Latest book!:
    Mastering Power BI 2nd Edition

    DAX is easy, CALCULATE makes DAX hard...
    Message 3 of 21
    82,760 Views
    1
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign in
    • Sign up

    Browse

    • Solutions
    • Partners
    • Consulting Services

    Downloads

    • Power BI Desktop
    • Power BI Mobile
    • Power BI Report Server
    • See all downloads

    Learn

    • Guided learning
    • Documentation
    • Support
    • Community
    • Give feedback
    • Webinars
    • Developers
    • Blog
    • Newsletter

    © 2023 Microsoft

    Follow Power BI

    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    Consumer Privacy Act (CCPA) Opt-Out Icon Your Privacy Choices