DAX - Year to Date Calculation

Hi All,
We have a requirement of calculating the Year to Date Calculation in DAX for No. of Sales. Below is the table that we are using:
Year
Quarter
Date
No. of Sales
 If we browse the tabular model with Year/Quarter then formula should calculate the value at quarter levels.
Formula Definition for Q1 = (Total of “No. of Sales” in current Year upto Q1  / Total of “No. of Sales” in previous Year upto Q1) -1
Formula Definition for Q2 = (Total of “No. of Sales” in current Year upto Q2  / Total of “No. of Sales” in
previous Year upto Q2) -1
Formula Definition for Q3 = (Total of “No. of Sales” in current Year upto Q3  / Total of “No. of Sales” in
previous Year upto Q3) -1
Formula Definition for Q4 = (Total of “No. of Sales” in current Year upto Q4  / Total of “No. of Sales” in
previous Year upto Q4) -1
Can anybody help us in building this formula in DAX which should be able to browse with any columns of the table.
Thanks,
Vishal Jharwade

Hi Vishal,
According to your description, we are still not clear about your requirement. Do you want to calculate the "current YTD/previous YTD -1"? Or you want to calculate the Total Year to Quarter for each quarter?
If you want to calculate the first one, please use the formula below:
=[Sales](DATESYTD(DimDate[Datekey])) - [Sales](DATEADD(DATESYTD(DimDate[Datekey]),-1,YEAR))
If you want to calculate the second one, you can use TotalYTD() function to calculate the Year to Quarter value:
=TOTALYTD(SUM(InternetSales_USD[SalesAmount_USD]),DateTime[DateKey], ALL(‘DateTime’), “3/31”)
However, since we have to specify a literal string with a date that defines the year-end date, it can't make it dynamically to show the Year to Quarter for the current quarter. So you still can't use only one formula to deal with all quarters.
Reference:
First steps in DAX: Year-To-Date
Time Intelligence Functions in DAX
Best Regards,
Simon Hou
TechNet Community Support

Similar Messages

  • Are Cube organized materialized view with Year to Date calculated measure eligible for Query Rewrite

    Hi,
    Will appreciate if someone can help me with a question regarding Cube organized MV (OLAP).
    Does cube organized materialized view with calculated measures based on time series  Year to date, inception to date  eg.
    SUM(FCT_POSITION.BASE_REALIZED_PNL) OVER (HIERARCHY DIM_CALENDAR.CALENDAR BETWEEN UNBOUNDED PRECEDING AND CURRENT MEMBER WITHIN ANCESTOR AT DIMENSION LEVEL DIM_CALENDAR."YEAR")
    are eligible for query rewrites or these are considered advanced for query rewrite purposes.
    I was hoping to find an example with YTD window function on physical fact dim tables  with optimizer rewriting it to Cube Org. MV but not much success.
    Thanks in advance

    I dont think this is possible.
    (My own reasoning)
    Part of the reason query rewrite works for base measures only (not calc measures in olap like ytd would be) is due to the fact that the data is staged in olap but its lineage is understandable via the olap cube mappings. That dependency/source identification is lost when we build calculated measures in olap and i think its almost impossible for optimizer to understand the finer points relating to an olap calculation defined via olap calculation (olap dml or olap expression) and also match it with the equivalent calculation using relational sql expression. The difficulty may be because both the olap ytd as well as relational ytd defined via sum() over (partition by ... order by ...) have many non-standard variations of the same calculation/definition. E.g: You can choose to use or choose not to use the option relating to IGNORE NULLs within the sql analytic function. OLAP defn may use NASKIP or NASKIP2.
    I tried to search for query rewrite solutions for Inventory stock based calculations (aggregation along time=last value along time) and see if olap cube with cube aggregation option set to "Last non-na hierarchical value" works as an alternative to relational calculation. My experience has been that its not possible. You can do it relationally or you can do it via olap but your application needs to be aware of each and make the appropriate backend sql/call. In such cases, you cannot make olap (aw/cubes/dimensions) appear magically behind the scenes to fulfill the query execution while appearing to work relationally.
    HTH
    Shankar

  • Month to Date and Year to date calculation

    Hello Experts,
    It would be great If you could provide the formula to implement in BO universe or in the Reporting level for the below requirement.
    MTD, LastMonth, Year to Date, Last to LastMonth and examples are below.
    Last Week:
    Eg: Monday through Sunday
    Description: Based on Todayu2019s date, select the Monday of the previous week for the start date and Sunday will be the end date.
    Example:
    If Today is May 22, 2009
    The result would be, Monday = May 11, 2009, Sunday = May 17, 2009
    MTD:
    If Today is May 22, 2009
    I need a result MTD = May 1, 2009 u2013 May 21, 2009
    LastMonth:
    If Today is May 22, 2009
    I need a result LastMaont = April 1, 2009 u2013 April 30, 2009
    Last to LastMonth:
    If Today is May 22, 2009
    I need a result LastMaont = March 1, 2009 u2013 March 31, 2009
    Thank you.

    Nisniki,
    Here are the methods using WebI:
    MTD: 
    Create a local variable "MTD Start"
    =RelativeDate(LastDayOfMonth(RelativeDate(CurrentDate();-30));1)
    Create a local variable "MTD End"
    =currentdate()
    LastMonth
    =LastDayOfMonth(RelativeDate(CurrentDate();-30))
    Year to Date
    create a local variable "YTD Begin"
    =ToDate("01/01/"+FormatNumber(Year(CurrentDate());"####");"mm/dd/yyyy")
    (reuse "MTD End" or build a "YTD End" variable same as "MTD End")
    Last to LastMonth
    (similiar to MTD, but using "60" versus "30" to move back two months versus moving back 1 month.
    To perform this stuff in the universe requires an understanding of the SQL syntax for the paricular vendor your are working with.  ANSI SQL agrees to represent and compute dates uniformly, however, the functions to make it happen varies by the vendor.
    Thanks,
    John

  • Regarding year to date Calculations

    Hello,
            I Have a requirement to calculate the Year to date. When i input the value 009/2008 the exit should calculate the value from 001/2008 - 009/2008. the values should cumulate.
    For eg: For the period: 002/2008 value is 10
                                     003/2008 value is 20.
        cumulative value should be 30.
    Thanx in advance

    Hi,
    there are content varables that you can use in a query for this purpose. They are deliverd for the InfoObjects 0CALMONTH (0CYTLM: 'Cumulated to last month' or 0CYTCM 'Cumulated to current month' for example) and 0FISCPER. They select the complete range from periode 01 to your actuel month and therfore give you the cumulated value.
    Hope that helps
    Regards
    Christoph Vortkamp

  • Year to date calculations

    Hi All,
    I am using Planning V11
    I wanted to display YTD data on webforms. Now the data is loaded at the month level and there is a requirement to see the values for YTD aswell.
    I wanted to know the best practices around calculating YTD data in planning.
    There is a specific requirement to display periodic and YTD data on data forms.
    Your inputs and suggestions would be really helpful.
    Cheers,
    XXX

    It's possible, but mildly tricky.
    The reason is this . . . you would ideally like to calculate this variance on the database (in Planning/Essbase) and not on the form, which would require custom JavaScript. Unfortunately, with Planning, there are significant restrictions on what you can do with years. They have to start with FY and be followed by two numbers, and so on. What you would really like to do is create a "variance" year with a member formula that says, "@VAR(&ThisYear, &LastYear). But you can't do that in planning.
    So what you COULD so is this . . . create a variance Scenario that calculates the year-over-year variance for a given Scenario. The formula would look something like this @VAR(&ThisYear->"Budget", &LastYear->"Budget") The members with the "&" are substitution variables, if you weren't aware. I would make this variance scenario dynamic. You would need a separate member for each scenario where you wanted a variance, but it would work.
    Then on your forms, you would have the following dimensions in your columns: Scenario, Year, Period.
    Column 1 would be: "Budget", &ThisYear, YTD(&CurrentPeriod)
    Column 2 would be: "Budget", &LastYear, YTD(&CurrentPeriod)
    Column 3 would be: "Budget This Year vs Last Year", &ThisYear, YTD(&CurrentPeriod)
    This is just one idea. There are other ways to achieve this.
    Hope this helps,
    - Jake

  • 1 & 2 Year Calendar Date Calculations

    Hi All,
    I am a total newbie to designing forms so please bear with me.
    I am currently working with a lease form and i need to do the following:
    I want to be a to fill in a date field with a Lease Start date: ex.. "09/01/2010"
    and have a script or calculation output the corresponding 1 and 2 year Lease End Dates to separate date fields.
    which in this case would be 1 year "08/31/2011" 2 year "08/31/2012".
    I want it to verify that the dates are correct and account for leap years.
    I would prefer if this could be done in Formcalc, as I have no experience whatsoever in using Javascript.
    Thank you in advance for any help you guys can provide.

    I just created a sample foe someone else on this same topic. In this instance using Javascript is easier than FormCalc so that is what I used. We can take the date field and separate it into its components of day, month and year. Once we have the year we can add 1 or 2 to it and then simply put the date back together again to make a date. This way we do not have to worry about leap years ar adding 365.25 days. Have a look at the code ..it is pretty straight forward. If you have questions do not hesitate to ask. The code is on the click event of the button.
    Paul

  • Year to Date Calculation in Discover Report

    Hi,
    I've got a problem with calculated items in discoverer which I just can't seem to find an easy answer for.
    I have a matrix report with 6 columns as and the time period as page item as follows:
    Month: June 2002
    Sales Budget Variance Sales YTD Budget YTD Variance
    However, I don't know how to calculate the Sales YTD and Budget YTD as these values are variable dependent on the month selected.
    Any answers, (especially quick and easy answers) are greatly appreciated.
    Thanks in advance!!!

    You could setup a table that would include Date.. and values for the six data elements. This table could be populated nightly. This moves much of the complexity of your request out of discoverer and into the database.
    If you are wanting to continue to develop in discoverer only then you will need to create Functions and access them from discoverer.
    Best of Luck,
    Christopher
    www.billboard.net

  • Year to date calculation

    Hi experts,
    I need to create a request where I calculate year_todate costs for the previous year (one year ago)
    Let's say I have the following figures for 2000:
    year________Month_________Day______Acutal Coasts
    2000________Jan___________1____________10
    2000________Jan___________2____________20
    2000________Jan___________3____________30
    I used the AGO function to retrieve the previous year costs so I end up with the following request:
    year________Month_________Day______Acutal Coasts_____Previous year costs
    2001________Jan___________1____________5_________10
    2001________Jan___________2____________6_________20
    2001________Jan___________3____________7_________30
    And to calculate the year_todate costs and I tried OBIEE to_date fucntion :TO_DATE(Previous year costs) , the results was:
    year________Month_________Day______Acutal Coasts_____Previous year costs
    2001________Jan___________1____________5_________10
    2001________Jan___________2____________6_________30(10+20)
    2001________Jan___________3____________7_________60(10+20+30)
    When I look at the results at Month level
    year________Month______Acutal Coasts_____Previous year costs
    2001________Jan____________5_________100 (10+30+60)
    It's summing up all the coasts at day level and I only need the last value of a month, or a year if I want to display the results at year level.
    I also tried to use the RSUM function, but because it's only a display function when I filter on a day (for example day 2 JAN) I only got the results without any running sum:
    2001________Jan___________2____________6_________20 (because I exculed the other days with the filter)
    Any ideas how I achieve this:
    year________Month______Acutal Coasts_____Previous year costs
    2001________Jan____________5___________60 when I look at the month level
    and
    2001________Jan___________2____________6_________30 when I look at the day level.
    Regards

    Thanks venkat for the answer.
    It's only solving the problem at month level
    year________Month______Acutal Coasts_____Previous year costs
    2001________Jan____________5___________60 when I look at the month level
    but at day level it's just repeating the value at month level for every day
    year________Month_________Day______Acutal Coasts_____Previous year costs
    2001________Jan___________1____________5_________60
    2001________Jan___________2____________6_________60
    2001________Jan___________3____________7_________60
    and I want to have the following if I filter on 1JAN and 3JAN
    year________Month_________Day______Acutal Coasts_____Previous year costs
    *2001________Jan___________2____________6_________30(10+20)*
    Regards

  • Year to Date using SAP variables

    I've run into a sticking point when trying to create a year to date calculation that works without user entry. The infocube is updated by finance each month (for the previous month) after the final adjustments are made. For this reason, when the query pulls YTD information, it should be cumulating from January 20XX to Current Month - 1.
    The first way that I tried was to use overlapping restrictions: Fiscal Year/Period < Current Fiscal Year/Period AND Fiscal Year = Current Fiscal Year. This worked very well until we reached January. Now the overlapping restrictions return no results since all previous months are not in the current fiscal year.
    I've also attempted using the SAP exit variable 0FYTLFP (Cumulated to Last Fiscal year Period) on Fiscal Year/Period. It is not working, and I assume it is because the last fiscal year period is falling into a different fiscal year. Using it today, the value I get is equal to the value for Jan 2007. The variable seems to first look up the first day of the current fiscal year, saves that as one end of the range, then goes to the previous month to get the other end of the range. I tried offsetting this variable by -1 and the value returned was equal to Dec 2006, but not YTD.
    I'm assuming it must be possible to use the standard SAP delivered objects to create a working YTD calculation that does not require manual entry and cumulates correctly through current period - 1. Does anyone have any suggestions?
    Thanks!

    Dear Adam,
    For Year to Date , We have created a Customer Exit , For working , Create a Variable for 0calday and populate that with from and to value ...to value would be Sy-datum and From value is year starting date. Hope it helps..
    Thanks,
    Krish

  • Moving average price calculation based on year to date figures

    Hello,
    I've been working for months on the stock valuation at month end closing for the Finance department. We discover a situation where the moving average price is not calculated as we expected.
    The situation is as follows:
    2 purchase orders for the same material at different periods and with different purchase order prices
    the invoice of the first pruchase order has been recorded after the good receipts of the 2 purchase orders with purchase price variance, good issues have been recorded between the good receipts and the first invoice receipt, therefore the stock quantity is lower than the quantity invoiced
    the invoice of the second purchase order has been recorded as well with price purchase variance after the first invoice and after good issues, therefore the stock quantity is lower than the quantity invoiced.
    Here is an example with figures:
    SAP Calulation
    Good entry
    Good Issue
    Before Posting
    After Posting
    Good receipt
    Invoice receipt
    Date
    Movement
    Quantité
    Price
    Value
    Quantité
    Price
    Value
    Quantité
    Value
    PMP
    Quantité
    PMP
    Value
    Quantité
    PMP
    Value
    01.01.2014
    Intial Stock
    2000
    11
    22000
    16.01.2014
    Purchase Order 1
    10000
    10
    100000
    2000
    11
    22000
    12000
    10,17
    122040
    20.01.2014
    Good issue
    2000
    20340
    10,17
    12000
    10,17
    122040
    10000
    10,17
    101700
    18.02.2014
    Purchase Order 2
    20000
    9
    180000
    10000
    10,17
    101700
    30000
    9,39
    281700
    22.02.2014
    Good issue
    22000
    9,39
    206580
    30000
    9,39
    281700
    8000
    9,39
    75120
    30.03.2014
    Purchase Order 1
    10000
    9,5
    95000
    8000
    9,39
    75120
    8000
    8,89
    71120
    21.04.2014
    Good issue
    2000
    8,89
    17780
    8000
    8,89
    71120
    6000
    8,89
    53340
    31.05.2014
    Purchase Order 2
    20000
    7
    140000
    6000
    8,89
    53340
    6000
    6,89
    41340
    - When the first invoice is recorded, SAP calculate the MAP this way: ( 8000*9,39 + (95000-100000) * (8000/10000) ) / 8000 = 8,89
    - When the second inoice is recorded, SAP calculate the MAP this way: ( 6000*8,89 + (140000-180000) * (6000/20000) ) / 6000 = 6,89
    Moving average price calculation requirement
    Good entry
    Good Issue
    Before Posting
    After Posting
    Good receipt
    Invoice receipt
    Date
    Movement
    Quantité
    Price
    Value
    Quantité
    Price
    Value
    Quantité
    Value
    PMP
    Quantité
    PMP
    Value
    Quantité
    PMP
    Value
    01.01.2014
    Intial Stock
    2000
    11
    22000
    16.01.2014
    Purchase Order 1
    10000
    10
    100000
    2000
    11
    22000
    12000
    10,17
    122040
    20.01.2014
    Good issue
    2000
    20340
    10,17
    12000
    10,17
    122040
    10000
    10,17
    101700
    18.02.2014
    Purchase Order 2
    20000
    9
    180000
    10000
    10,17
    101700
    30000
    9,44
    283200
    22.02.2014
    Good issue
    22000
    9,44
    207680
    30000
    9,44
    283200
    8000
    9,44
    75520
    30.03.2014
    Purchase Order 1
    10000
    9,5
    95000
    8000
    9,44
    75520
    8000
    9,28
    74240
    21.04.2014
    Good issue
    2000
    9,28
    18560
    8000
    9,28
    74240
    6000
    9,28
    55680
    31.05.2014
    Purchase Order 2
    20000
    7
    140000
    6000
    9,28
    55680
    6000
    8,03
    48180
    - When the first invoice is recorded, SAP should calculate the MAP this way: (2000*11+10000*9,5+20000*9)/(2000+10000+20000) = 9,28
    - When the second inoice is recorded, SAP should calculate the MAP this way: (2000*11+10000*9,5+20000*7)/(2000+10000+20000) = 8,03
    Could you tell me if you know how to set up the calculation based on this formula (Intial stock value at MAP + Year to date Purchasing value) divided by (intial stock quantity + quantity purchased)?
    Thank you in advance
    Regards

    Arti,
    MBEWH table will get you the MAP of a material monthwise,I guess you need to get the logic which will use those details to arrive on MAP for a paritcular date.
    Check the SDN Forums with the keyword "MOVING AVERAGE PRICE REPORT" to get some lead.
    moving average price report
    K.Kiran.

  • Fiscal Month/Year Date Calculations

    Hi Gurus,
    I am trying to create a fiscal year and fiscal month offset using filter advanced SQL in answers. The “Offset” should allow to define a period of time + or – from a given starting point in order to report on a period of time. For example the Current Month Offset - When the variable is defined and set-up in the “Time” drop down menu in Answers. You would select Current Month Offset and in the create/edit filter dialog the Current Month Offset column contains a value of 0 for the most recent loaded month of data, a value of -1 for the month prior to that and so on. By selecting the “Operator”, “is between” and “Value” -5 and “Value” 0 you would filter to display the last 6 months.
    I created the offset with calendar year using the Advanced filter and worked fine for if i need to change the year to what ever value
    (((YEAR(CURDATE())-YEAR(Time.Date)) * 12) + (MONTH(CURDATE())-MONTH(Time.Date))) * -1 = -1
    The issue comes when i create for Fiscal year and Fiscal month using filter advanced SQL it throws an error
    (((FISCAL YEAR(CURDATE())-FISCALYEAR(Time.Date)) * 12) + (FISCAL MONTH(CURDATE())-FISCAL MONTH(Time.Date))) * -1 = -1
    for fiscal year it throws an error below
    Error getting drill information: SELECT Time."Fiscal Year" saw_0, Time."Fiscal Year" saw_1 FROM "AAFES Procurement - Purchase Orders" WHERE Time."Fiscal Year" = (((FISCAL YEAR(CURDATE())-FISCALYEAR(Time.Date)) * 12) + (FISCAL MONTH(CURDATE())-FISCAL MONTH(Time.Date))) * -1 = -1
    Error Details
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <CURDATE>: Syntax error [nQSError: 26012] . (HY000)
    SQL Issued: {call NQSGetLevelDrillability('SELECT Time."Fiscal Year" saw_0, Time."Fiscal Year" saw_1 FROM "AAFES Procurement - Purchase Orders" WHERE Time."Fiscal Year" = (((FISCAL YEAR(CURDATE())-FISCALYEAR(Time.Date)) * 12) + (FISCAL MONTH(CURDATE())-FISCAL MONTH(Time.Date))) * -1 = -1')}
    Thanks
    Simmz

    Hi,
    Kindly refer the below link it may help you.
    http://obieeelegant.blogspot.com/2011/06/obiee-date-expressions-reference.html
    Thanks
    Deva

  • Calculation of ''Total to Date'' like ''Year to date''

    Hello together,
    How would you calculate a Total to Date in Oracle BI.
    It should sum all values like Year to date up to a certain period inclusive all previous years.
    Example:
    Year Value
    2008 10
    2009 20
    2010 40
    If I select 2009 it shoul display 30. without the previous and the following row.
    Regards,
    Stefan
    Content Level Fiscal Period TOTAL (Do I have to calculate on a yearly level all the past years, - ago - 1, ago -2, ago - 3, ago - 4 up to - 20?)
    minus Year Value
    plus YTD
    Month and Total have to bes diplayed in on line.
    works for the current year but not when you back to last year.
    Edited by: stefanhess on Jun 14, 2010 1:54 PM

    an odd solution.
    In the physical layer you can duplicate the fact table and can join the time dim and duplicated fact with the complex join using the year column with the condition as
    time_dimension.year_column >= fact_table.year_column
    in your report when you bring the year and this measure you will get what you want.
    Edited by: kart on Jun 14, 2010 6:46 PM

  • Calculating HTD(Half Year to date) in Essbase

    Hi All,
    Is there any way in essbase where in you can calculate HTD(half year to date) Values.
    I know in essbase we have Dynamic time series where in you can calculate YTD,HTD(History to date),MTD,QTD,...etc.
    can you guys have any thoughts on as how HTD(half year to date) is achievable in essbase.
    thanks in advance.

    Can you modify your time dimension to look like
    Time
    -1st Half
    ---Qtr1
    ------Jan
    ------Feb
    ------Mar
    ---Qtr2
    ------Apr
    ------May
    ------Jun
    -2nd Half
    ---Qtr3
    ------Jul
    ------Aug
    ------Sep
    ---Qtr4
    ------Oct
    ------Nov
    ------Dec
    If so, you could enable a dts member and set the alias to be hf-t-d
    if you can't add those members, condider adding a dynamic calc member with a formula
    psudo logic would be
    If it is a descendant of Q1 or Q2 then sum Jan to the current month else if it is a descendant of q3 or 4 sum jul to the current month

  • Year to Date and Monthly totals

    I know that this is rather simplistic, but I'm new to Discoverer and need to set up a bunch of sales reports with MTD and YTD columns. I'm going to be using the same SQL query for many of my reports but customizing the reports to show sales by state, product line, etc.
    Is there a formula/function I can use in Discover for the Month to Date and Year to Date totals?
    Thanks,
    Joseph

    Hi Joseph
    You can use the analytic range SUM calculation for these. For the month to date, use the a PARTITION BY of month with a range of all the preceding rows in the partition up to and including the current row. For the year, you would simply change the PARTITION BY to be the year.
    Here are some examples drawn from my own database:
    I have the following items:
    ORDER_YEAR
    ORDER_MONTH
    ORDER_DATE
    SELLING_PRICE
    With these defined, the formula for month to date is:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS UNBOUNDED PRECEDING)
    The formlua for year to date is:
    SUM(Selling Price SUM) OVER(PARTITION BY ORDER_YEAR  ORDER BY  ORDER_DATE ASC  ROWS  UNBOUNDED PRECEDING )
    Basically what we are doing is telling Discoverer to SUM the SELLING_PRICE, and you should be able to take these and adjust them for your own report.
    Let me take a look at the month to end and describe what is going on. Basically the PARTITION BY is defining a set of rows which are to be included. In this case it is all rows that have the same ORDER_MONTH. The ORDER BY clause tells Discoverer to place the items in order, with the oldest order first. The ROWS UNBOUNDED PRECEDING tells Discoverer to SUM all of the items within the set (within the PARTITION BY) from the oldest item (UNBOUNDED PRECEDING) to and including the current item. We could have added a BETWEEN clause too but that is implied. With a BETWEEN clause it would look like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    If you want the current row to be included with UNBOUNDED PRECEDING you don't need to explicitly name it because that is the default. Other options you could use are these:
    UNBOUNDED FOLLOWING - this SUMS to the end of the PARTITION
    ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING - you can guess that this will add all of the items, which you will rarely use because if you omit the ROWS command then this range between first and last is actually the default
    Rather than ROWS BETWEEN you can also say RANGE BETWEEN, like this:
    SUM(Sales.Selling Price SUM) OVER (PARTITION BY ORDER_MONTH ORDER BY ORDER_DATE ASC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
    I hope this little dissertation on running totals helps.
    Best wishes
    Michael

  • Return current period based off of current fiscal year and date

    Good Afternoon,
    Is there a way in the webi that I can create a dimension that always reflects the current Fiscal Month based of Fiscal year and date? I have a report that I am trying to show sales for a customer based off the current fiscal month. I would like this report when refreshed to be based off this fiscal month dimension instead of showing each fiscal month or changing it manually. What is the best way to do this?
    I have attached an image that shows current numbers by period (month) and then the YTD Totals. I would like to have my 'Period' column always reflect the current period and the Total column to reflect that months totals based off the period column. So for this period (3), instead of seeing 3 lines for each month I would just see the '3' and the total as $541,310.46, monthly as 412,502.09 and my YTD as 1,080,091.06.
    Any help is always appreciated!
    Thank you,
    Tiffany

    Hi,
    Create a variable
    FlagVar=If([Period]=Max([Period]) In Report;"Show";"Hide")
    And apply block filter of FlagVar=Show
    Are these coming TotalSales  MonthlyGoal YTDSales directly from universe? If they are calculated at report level then you might want to use NoFilter. like =NoFilter([YTDSales])

Maybe you are looking for

  • IPhone 3G Wi-fi Problem

    Hi. I have a problem connecting the iPhone 3G with my router. I does not connect when I have the WPA 2 encryption on but with my iPod Touch it works perfectly. I have the 2.0.2 software on both. When I remove the encryption it works but I don't wanna

  • If I upgrade to Icloud will I lose all my mail ? contacts etc.. Im on lion.

    If I upgrade to Icloud will I lose all my mail ? contacts etc.. Im on lion.

  • "The application SyncServer quit unexpectedly"

    I'm looking for help. I have a recently new 24" iMac. About 3 times a day the computer comes to a halt I can't do anything (basically freezes). After about 5 mins I get an error stating "The application SyncServer quit unexpectedly". I looked at othe

  • Current swatch in control palette

    I think it would be nice to have the active swatch displayed in the control palette, just like the other information about whatever object is selected. Unless I am mistaken, the only way (in CS4) to see the color of a selected object, or of the selec

  • Leading zeros are disappearing!!

    Hello I am downloading sales order data from SAP (ECC 6.0) to a spread sheet/Excel (2003 and 2010 versions) on desktop. I am sending the sales order # as 0012345678, customer # as 0087654321, sales org as 0123 (saw in debug mode), but, when i check t