SSAS Tabular - TOTALYTD function

Answered SSAS Tabular - TOTALYTD function

  • Saturday, January 19, 2013 1:02 AM
     
     

    Hi,

    I have the below DAX expression to calculate the YTD values for a measure in a year.

    CountYTD:=TOTALYTD(SUM(Fact[Count]),Date[DateKey])

    The above expression working correctly if the year starts on Jan, 01 and ends on Dec, 31.

    But in my case, year starts on Apr, 01 and Ends on March, 31. When I try the same expression to calculate the YTD values, it is not showing results based on my dates. It is working based on Jan, 01 as year start date and Dec, 31 as year end date.

    Any pointer to resolve the issue will be greatly appreciated!

    Thanks,

    N


    - naveen.reddy

All Replies

  • Saturday, January 19, 2013 3:24 AM
     
     Answered Has Code
    TOTALYTD (and other year-related Time Intelligence functions) takes an optional parameter to specify year-end.  In the case of TOTALYTD, the optional year-end is specified in the third parameter like this:
    CountYTD:=TOTALYTD(SUM(Fact[Count]),Date[DateKey],"03-31")
    Let me know if that helps.

    Brent Greenwood, MS, MCITP, CBIP
    // Please mark correct answers and helpful posts //
    http://brentgreenwood.blogspot.com



    • Edited by Brent Greenwood Saturday, January 19, 2013 3:26 AM
    • Marked As Answer by navin.reddy Monday, January 21, 2013 9:51 AM
    •  
  • Monday, January 21, 2013 9:52 AM
     
     
    Thanks Brent for the reply and pointer :) I have applied the above and it worked. Once again thanks!

    - naveen.reddy