Different totals based on dates (month vs date range)

I know I've seen this before, but I can't find the thread. I have a column in a fact table for price. When I add price and the month (eg April 2012) from the time dimension, it totals one number, but when I remove the month, and add a date range (4/1/2012 - 4/30/2012) it totals another (lower value). I can't find the solution I found last time.
Anyone else run into this? and solve it?

RiZapata wrote:
I know I've seen this before, but I can't find the thread. I have a column in a fact table for price. When I add price and the month (eg April 2012) from the time dimension, it totals one number, but when I remove the month, and add a date range (4/1/2012 - 4/30/2012) it totals another (lower value). I can't find the solution I found last time.
Anyone else run into this? and solve it?The solution is to understand what OBIEE is doing. If the totals differ, then the definitions are different. You need to troubleshoot to see what the difference is. When you add the month column and the date (so you can see every date) and add the total then, which total does it tie to? Is there rounding? How off are the two totals? That often may give a clue as to what is missing in the lower total.

Similar Messages

  • Delivery Block at PGI level based on GI date and Month end date

    Business need a check on delivery processing based on the Planned GI date, Month end date and transit period. This transit period is a custom field and dependent on customer. Also it is not maintained anywhere in system. Business store it in some excel format.
    The logic needed is: For any given month, the delivery order MUST be goods issued in the same month, i.e. once the order is delivered, the Post goods issue should ONLY be allowed if and only if , the PLANNED GI date ( as maintained in delivery ) + transit time ( at customer level ), falls within the month end date. If not, a block should be applied at PGI and only authorized personnel should be able to release that block.
    Also, there will be no check at invoicing VF01 level. Once the PGI blocked is removed, there will be no check on invoicing. The month end date may vary month to month and need to in combination of Sales Org / Plant as mentioned
    In addition, the business need an exception report where the information of releasing the block should appear for release date, user id of the responsible person, time sales order no etc. and it should be downloadable.
    We can have a custom table to maintain the month end day in given combination.
    But I need your expert inputs as-
    1-     Can we add this transit period in at customer master data as it is dependent on customer and there are huge no of customers for the sales unit? If not, then how to maintain it; may be a z table?
    2-     Based on this logic, what should the code/logic to be written for block at PGI.
    3-     How to control the authority check for removing the block.
    4-     The source fields for exception report.
    Pls revert accordingly.
    Many thanks in advance.

    Hello,
    Please refere the answers to your questions:
    1- Can we add this transit period in at customer master data as it is dependent on customer and there are huge no of customers for the sales unit? If not, then how to maintain it; may be a z table?
    You can either use some un-used Feild in Customer Master or maintain a Z-Table. I believe maintaining a Z-Table would be easy as you have huge number of Customers. You can also write a dmall program to Pick the Customer-wise transit dates from a excel file & store in Z-Table.
    2- Based on this logic, what should the code/logic to be written for block at PGI.
    You have explained the requirement well in your thread, you need to explain the same to your ABAPer & Basis person & they would do the needful.
    3- How to control the authority check for removing the block.
    Basis person would create & assign a Z-Authorization object which the ABAPer would use in his program.
    4- The source fields for exception report.
    Once you do the above development, your ABAPer will easily pick the required feild in Report as he has already used all the feilds somewhere in his development.
    Hope this helps,
    Thanks,
    Jignesh Mehta

  • Select records based on monthly anniversary date

    Hi,
    I have a table with a date_added field and I want to select records based on the monthly anniversary date of this field.
    eg. ID, Date_added
    1, 10-DEC-2012
    2, 11-NOV-2012
    3, 10-MAR-2012
    4, 28-FEB-2012
    5, 30-DEC-2012
    So For the 10th of Jan 2013, I would want to return records 1 and 3 only
    I started looking at the extract function, but this soon falls down for records at the end of the month. For example, on the 28th Feb, I would also want to include records where the date_added day is the 29th, 30th or 31st. So, in the table above I would want to return records 4 and 5, but extract would only return 4.
    Is there a simple function to do this month anniversary query - am I missing something very obvious? Or, do I need to write a query to explicitly cope with dates at the end of the month? So far I haven't found a sensible simple solution!
    I'm using 11g
    thanks

    I didn't look into leap year, but this should give you a starting point:
    select  *
      from  t
      where 1 = case last_day(to_date(:target_date,'mmddyyyy'))
                  when to_date(:target_date,'mmddyyyy')
                    then case
                           when to_char(date_added,'dd') >= to_char(to_date(:target_date,'mmddyyyy'),'dd')
                             then 1
                         end
                  else case
                           when to_char(date_added,'dd') = to_char(to_date(:target_date,'mmddyyyy'),'dd')
                             then 1
                         end
                end
    /For example, target date is 1/10/2013:
    SQL> variable target_date varchar2(8)
    SQL> exec :target_date := '01102013';
    PL/SQL procedure successfully completed.
    SQL> with t as (
      2             select 1 id,to_date('10-DEC-2012','dd-mon-yyyy') date_added from dual union all
      3             select 2,to_date('11-NOV-2012','dd-mon-yyyy') from dual union all
      4             select 3,to_date('10-MAR-2012','dd-mon-yyyy') from dual union all
      5             select 4,to_date('28-FEB-2012','dd-mon-yyyy') from dual union all
      6             select 5,to_date('30-DEC-2012','dd-mon-yyyy') from dual
      7            )
      8  select  *
      9    from  t
    10    where 1 = case last_day(to_date(:target_date,'mmddyyyy'))
    11                when to_date(:target_date,'mmddyyyy')
    12                  then case
    13                         when to_char(date_added,'dd') >= to_char(to_date(:target_date,'mmddyyyy'),'dd')
    14                           then 1
    15                       end
    16                else case
    17                         when to_char(date_added,'dd') = to_char(to_date(:target_date,'mmddyyyy'),'dd')
    18                           then 1
    19                       end
    20              end
    21  /
            ID DATE_ADDE
             1 10-DEC-12
             3 10-MAR-12
    SQL> And target date is 2/28/2013:
    SQL> exec :target_date := '02282013';
    PL/SQL procedure successfully completed.
    SQL> with t as (
      2             select 1 id,to_date('10-DEC-2012','dd-mon-yyyy') date_added from dual union all
      3             select 2,to_date('11-NOV-2012','dd-mon-yyyy') from dual union all
      4             select 3,to_date('10-MAR-2012','dd-mon-yyyy') from dual union all
      5             select 4,to_date('28-FEB-2012','dd-mon-yyyy') from dual union all
      6             select 5,to_date('30-DEC-2012','dd-mon-yyyy') from dual
      7            )
      8  select  *
      9    from  t
    10    where 1 = case last_day(to_date(:target_date,'mmddyyyy'))
    11                when to_date(:target_date,'mmddyyyy')
    12                  then case
    13                         when to_char(date_added,'dd') >= to_char(to_date(:target_date,'mmddyyyy'),'dd')
    14                           then 1
    15                       end
    16                else case
    17                         when to_char(date_added,'dd') = to_char(to_date(:target_date,'mmddyyyy'),'dd')
    18                           then 1
    19                       end
    20              end
    21  /
            ID DATE_ADDE
             4 28-FEB-12
             5 30-DEC-12
    SQL> SY.

  • With SPD adding 1 month to date not working?

    I have a calculated column [1stDayofMth] =DATE(YEAR([Start Date]),MONTH([Start Date]),1) which appears to be working fine.
    My SPD WF uses the [1stDayofMth] column and does a few calculations to find the next 2 months 1st days
    [Month 1 Resume Date] = [1stDayofMth] + "1 Months" 
    [Month 2 Resume Date] = [1stDayofMth] + "2 Months"
    These dates are used to pause the workflow. The problem when I log the results to history these calculations are not the 1st day of the next month on some list items?
    eg (text from workflow history)
    1stDayofMth="11/1/2014 12:00:00 AM"
    Month 1 Resume Date="11/30/2014 11:00:00 PM"  |  Month 2 Resume Date="12/31/2014 11:00:00 PM"  |  Month 3 Resume Date="1/4/2015 11:00:00 PM"
    The [1stDayofMth] column is set to "Date Only" and is showing as only the date, my logging was set to show the String and I can see the time is included as well. Is this the cause?
    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

    As a band-aid I inserted a 2nd add for 2 hours to the date which will move it from the 30th at 11:00pm to the 1st at 1:00am. 
    I haven't done a lot of digging but it looks like the issue of adding 1 month to the 1stDayofMonth is only occurring on months with 30 days?
    Stunpals - Disclaimer: This posting is provided "AS IS" with no warranties.

  • Combining different measures based on different dates in a single table

    Hi,
    I'm attempting to produce a report that gives two counts of items in a database, the first based on the date added to the database, the second based on the date marked as deleted, all reported by month over the last 12 months.
    The following pertinent fields are available for use in the query builder:
    Item ID, Entry Date, Deleted Date, End date of previous month, End date of previous month last year.
    The report should look something like this:
    Month.....Total Items....Additions....Deletions
    May 08....54.............. 43...............3
    Apr 08.....654..............600.............0
    Mar 08.....654..............0................0
    Feb 08.....654.............10...............10
    Jan 08.....53................0................601
    Jul 08......96................3................2
    Jun 07.....46................4................54
    Month:
    =If(DaysBetween([Last Day Of Prev Month Prev Year];[Entry Date])>0;
    +Month([Entry Date]) + " " + FormatNumber(Year([Entry Date]);"####");+
    "Previous Balance")
    Total Items:
    =RunningSum(Count([Item Id]))-RunningSum(Count(Item ID) Where(Not(IsNull([Deleted Date]))))
    Item Additions:
    =Count([Item ID])
    Item Deletions:
    =Count([Item ID]) Where(Not(IsNull([Deleted Date])))
    The part I'm having problems with is splitting the results by month, such that the number of deletions equals the number of items deleted that month, rather than the number of items deleted that month of the items added that month. I.e. I need to split by month on the additions date for the additions column and by month on the deletions date for the deletions column.
    At the moment, if the 54 items deleted in Jul 07 were originally added to the DB in, say Mar 06, then they would show up as deletions in Mar 06 - because the Month column is being split out based on Additions date. Of course I could reverse this and split the months out by deletion date, but then I would have the same problem in reverse - I can't see any way of doing both.
    Any ideas?
    I hope I've explained that so that it makes vague sense, please ask if it doesn't!
    Many thanks in advance,
    Steve

    Have you tried splitting this out into 2 seperate queries the first to return the additions by month and the second to return the deletions by month. You should then be able to merge the date dimensions and report both additions and deletions against a single date dimension.
    Regards,
    Mike

  • Query to display data monthwise and calculate total for first 12 months

    Hi All,
    I have a query that displays forecast data monthwise.
    This has been achieved by adding 0CALMONTH on top of key figure structure.
    Eg: -
                            APR 2011   MAY 2011    JUNE 2011   ....... NOV 2013
                            Forecast      Forecast       Forecast             Forecast
    PRODUCT 1      10                15                    20                         25 
    Now there is a requirement to include new column that displays total of first 12 months data only.
    How can I achieve this without repeating the total value for every value of 0CALMONTH?
    Eg: -
                            APR 2011   MAY 2011    JUNE 2011   .......  MAR 2011    TOTAL of     APR 2012  .......       NOV 2013
                            Forecast      Forecast       Forecast             Forecast        12 months    Forecast                   Forecast
    PRODUCT 1      10                15                    20                         25               300              10                              30
    Any inputs will be appreciated.
    Thanks & Regards
    Manisha

    Hi,
    As far as i understand your requirement is to make a new keyfigure which has to be total of 12 months and that keyfigure should not get splitted based on calmonth which you have kept above the key figure structure in columns.
    I dont think it will be possible to achieve it that way.You need to make a fixed structure which will dispaly data for say next 12 months or whatever your user requirement is and you need to make a seperate  keyfigure with month offsets and then you can make  a seperate total keyfigure(of 12 months).
    With the help of text variable type replacement path you can get the seperate month names for all your forecasted keyfigures.
    I had the same requirement but my user wanted to see the next six months data only so i made it with the help of month offsets.
    If you get any other work around to achieve your requirement then please do share the solution with us.
    Hope it helps.
    Regards,
    AL
    Edited by: AL1112 on Sep 6, 2011 9:34 AM

  • Using SQL stored procedures How to get the list of .rar files from e:\Tempbackup directories from the different remote desktop windows server and delete the .rar files which contains the current month and date

    Concept:
    Every month i need to find the list of .rar files from the
    E:/TempBackup directory from the different environments (remote desktop servers) and i need to delete the current month
    .rar files alone from the respective (E:/TempBackup) directory. below is example files structure inside the
    E:/TempBackup.
    example:
    zDROP_2014_08_31_Backups.rar
    zDROP_2014_09_31_Backups.rar
    zDROP_2014_10_31_Backups.rar
    from the above list i need to delete the zDROP_2014_08_31_Backups.rar(current month) file alone and also logs should be capture for this deletion.
    key words for this are zDROP and Current month and date.
    i need a stored procedure for this concept. could you please help on this.

    Hello,
    You can schedule an operating system task (Control Panel -> Schedule task) to either call a batch file or a PowerShell script.
    Please read the following resources for examples:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/61373719-fffb-4d94-bdbe-7d8ed8620b44/delete-filesfolders-on-remote-servers-using-powershell?forum=winserverpowershell
    http://www.networknet.nl/apps/wp/archives/943
    http://jeffwouters.nl/index.php/2011/10/powershell-script-to-delete-files-older-that-a-week/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Current week/current Month/YTD data based on user response

    Hi
    I have one attribute request_created_date
    Based on this i want to create one more attribute which will have lovs as week(Request_created_date for current week),monthly(Request_created_date for current week),
    YTD(Request_created_date for current year to date).
    Now i want to use this new attribute (Having LOV as week/Month/YTD) as a report prompt so that user itself can select whether he wants to see
    week/month/YTD data in report.
    To Add to this :
    Req is something like this if user select week , Req_created_dates should be filtered for all the dates of cureent week.
    Req is something like this if user select month , Req_created_dates should be filtered for all the dates of cureent month.
    Req is something like this if user select Year , Req_created_dates should be filtered for all the dates of cureent year.
    How can i achieve this?

    Add One variable
    Time_Data ="Weekly"
    Create Input control (Radio Button)
    Use Custom LOVs (Add Weekly , Monthly , Yearly ).
    Set Default (Weekly).
    Now Create Another Variable
    User_Want = ReportFilter([Time_Data])
    Now filter your Report for week , Month or Year (as per Selection) using If else Statement .
    For eg.
    For Week
    [Created_Date] Between RelativeDate(CurrenDate();-7) And CurrentDate()
    For Month
    (Year([Created_Date]) = Year(CurrentDate())  And Month([Created_Date]) = Month(CurrentDate()))
    For Year
    (Year([Created_Date]) = Year(CurrentDate())

  • Last month end date based on current date

    Hi,
    How to show last month end date based on the current date.
    Eg:
    Current date = "08/26/09"
    Var- Last Month End Date = "07/31/09" etc...,
    Please help me how to get it...
    Thank You!

    Good to hear that it worked for you. but not for me.
    I tried like this:
    1st::
    1. var1= ToDate("06/30/09","MM/dd/yyyy")
    2.Var2= RelativeDate([Var1];-DayNumberOfMonth([Var1]))
    result: 5/30/09
    2nd:
    RelativeDate('6/30/2009';-DayNumberOfMonth('6/30/2009'))
    result: 5/30/09
    Am working on SAP OLAP cubes.
    Please help me where am going wrong....
    Thank You!

  • Month-to-Date and Year-to-Date values in Query

    Hello experts,
    One of our BI reports has the following requirement: the user should be asked for the report date. After the user inputs the date, the report shows the key figures in three different "flavors": one is the values for that date, the second one is the cumulate values from the first day of the month of the report date to the report date itself, and the third is the cumulate values from the first day of the year of the report date to the report date itself.
      I created my report date variable based on 0CALDAY. Then I searched for SAP-exit variables that would help me achieve this, but could not really find any, except for 0P_ABO10, 0P_ABO11, 0P_ABO12 variables, all of them have as description "Start of Key Date Year". I tried creating a few selections in which the dates taken were defined as a range from each of these variables to the report date variable (for the year-to-date values), but I got the error "Variable 0P_ABO10 could not be substituted". I also got this error for the other two variables. And I could not find any SAP-exit variables like "Start of Key Date Month", in order to do the Month-to-Date part. My next try was to use the field "Key Date" with a variable in it, instead my own report date variable based on 0CALDAY, but it gave me the same errors.
    I searched the forums and found a few threads that looked useful, like
    First and Last day of month and
    1st day of month / 1st day of week variables
    However, they require some ABAP coding, and I do not know where to place the code (actually, I do not know where to work with ABAP code), and I also believe that I would have to do some changes to it.
    Any suggestions?

    Hi Pedro,
    You have to create customer exit in T_Code: CMOD
    1. Create a Z project
    2. Select RSR00001 as enhancement type.
    3. Go into include ZXRSRU01
    4. create a code like
    Here A is your variable based on 0calmonth with type customer exit and B is variable for 0calday.
    Try to write logic for your case taking this as example.
    WHEN 'A'.
        IF I_Step = 2.
          Loop at I_T_VAR_RANGE into L_T_VAR_RANGE where VNAM = 'B'.
            Concatenate L_T_VAR_RANGE-LOW(4) '001' into D1.
            Concatenate L_T_VAR_RANGE-LOW(4) '012' into D2.
            Clear L_S_Range.
            L_S_Range-low = D1.
            L_S_RANGE-high = D2.
            L_S_RANGE-sign = 'I'.
            L_S_RANGE-opt = 'BT'.
            Append L_S_Range to E_T_Range.
          ENDLOOP.
        ENDIF.
    If you want exact code I can help you in that.
    Thanks,
    Kams

  • Organizing expenses into months using date

    I have a budget with a monthly expenses cell for each month and a different spreadsheet with an expenses list. I have it organized into date, expense, and price. I need to find a way to add the total of all of my expenses for a month without using 12 different tables.
    Thanks,
    McKenzie

    Assuming that expenses dates are stored in column B, the easiest way is to insert a column (here E) whose formula would be:
    =MONTH(B)
    In column G the formula would be:
    =SUMIF(E,ROW()-1,C)
    Yvan KOENIG (from FRANCE dimanche 1 mars 2009 16:21:44)

  • To get previous month's data

    Hi
    My report requirement:
    Display current month and previous month's data (sal) next to each other based on the month selected as a current month.
    Expression I'm using at the moment:
    case when trunc(lag(dt,1,dt) over (partition by ename order by dt),'MM') = trunc(add_months(dt,-1),'MM')
    then lag(sal,1,sal) over (partition by ename order by dt)
    However, instead of 'dt' I'm trying to use a parameter (dt as a current month's dt).
    This gives me an error message.
    Can anyone guide me on this?
    Thanks and regards,
    Aparna

    Why not simply join the table with itself? I.e. join the two months data sets and have a single row containing current and previous month results
    Simplistic example. We have a YEARLY_TOTALS table where the primary key is MONTH in the date format YYYY/MM. You can then compare the sales totals per month of this year with that of last year using the following type of SELECT construct:
    SELECT
    cur.month,
    cur.sales as CURRENT_SALES,
    prev.sales as LAST_YEAR_SALES
    FROM yearly_totals cur
    JOIN yearly_totals prev
    ON ADD_MONTHS(prev.month,12) = cur.month
    WHERE cur.month >= TRUNC(SYSDATE,'YY')

  • Discrepancy between OD entered in Months and Dates

    Hi all,
    We are facing a problem while entering the OD in Months.
    Example :
    When we enter the duration as 8m (for 8 Months) the dates shown are :
    12-Feb-10 to 10-Aug-10. The dates which we want are 12-Feb-10 to 12-Oct-10.
    The calendar selected is a 7 day week calendar and hours setting are 8 hours / day
    Also the Time Units user preferences are set to 8 hours / day.
    For the moment, we adjust the dates by selecting them irrespective of the OD.
    Kindly advise suitably.
    With Warm Regards,
    Uhde India Planning

    first of all, you should consider conversion of input data and scheduling (F9) as two different things.
    P6 versions prior to v7 use the admin prefs for time units (default values are 8h/d, 40h/w, 172h/m, 2000h/y) to convert between input unit of time for durations and the user pref display unit of time for durations.
    if you so choose (but I would recommend against it), you can allow different users to use different conversion sets (checkbox under admin/ admin prefs) and define custom user conversion sets (under edit/ user prefs).
    also check viewing options (under user prefs) for time sub-units, decimal points for duration fields and date-time (not just date) for date fields.
    the value you input in a duration field (such as OD of let's say "2m") is converted into h based on the aplicable h/m setting (=> 2*172=344h), and then back into whatever the user has set as display unit for durations (let's assume days => 344/8=43d displayed in the OD field).
    when scheduling (F9), the activity planned (early) finish date (& time) is calculated as planned (early) start date (& time) + original duration working hour count
    regardless of what the OD field displays in days (!). the database level name of the OD field is just that "target_duration_hr_cnt"
    scheduling is done by taking into account applicable activity/resource calendar first (depending on activity type), and then h/d for different days, d/m for different months, etc (as defined for the calendar in use). in other words, considering daily working period, lunch breaks, weekends, holidays, custom calendar exceptions.
    there are numerous other settings for scheduling (check out scheduling options). levelling (Shift+F9) is basically scheduling that comes with its own set of options and takes things to the next level by considering resource avaliability, float, maximum overallocation, network, constraints or custom project & activity levelling priority, etc.
    long story short :)
    the expected PF = PS + OD - 1 holds for Planned Start of Jan 1 + Original Duration of 3d = Planned Finish of Jan 3 but not for OD of 3m.
    whenever possible, you should try to build your schedule using:
    - relatively short activities (order of days or even hours =>durations input in days or even hours). the fewer conversions needed when inputing, the better.
    - consistent h/d, d/w within a given month. the fewer calendar exceptions the better.
    - correlation between the admin duration conversion set (8,40,172,2000) and activity/resource calendars (8h/d, 5d/w used for activity scheduling) and default calendar (used for duration and dates roll-up onto grouping bands)
    while scheduling is the same, P6v7 has improved the conversion mechanism in the way that the set of conversion rates to be used for conversion inbetween units of time (h,d,w,m,y) for duration fields (OD,RD,etc) is now available at the calendar level.
    this way, all (task-dependent) activities using the same (activity) calendar will convert inbetween the above mentioned duration units using the same ratios, set at the calendar level. the admin setting is somewhat obsolete.
    conversions are more consistent with calendar definitions, but that still doesn't mean that lunch breaks, weekends, holidays or custom calendar exceptions, as defined for the applicable calendar, will be considered when converting an input of "2m" into "43d" as displayed in the Original Duration field.
    if calendar conversion set says 1m=172h and 1d=8h, 2m=43d from Jan till Dec or the end of time for that matter :)
    the fact is that "2m" changes within the year, "2d" can vary within a month, week, etc
    it is safe to say that 1h stays the same and is usually either working or non-working, throughout the schedule of your multi-annual project
    that is unless you really really need sub-units of 0.25h or 3h 3mn, start / finish dates & time, coffe breaks from 10:30 to 11:00 and such :)
    Edited by: Tibi on Mar 9, 2010 4:20 PM
    Edited by: Tibi on Mar 9, 2010 4:21 PM

  • Month calculations: DATE() vs EDATE()

    In a recent topic (Challenge to get a date correctly), I mentioned using the DATE function to calculate a date that is (for example) one month later than a given one. Specifically, if cell A1 contains the given date, then I suggested using this formula for a date one month later:
    =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))
    Yvan Koenig suggested instead using the simpler EDATE formula, here equivalent to:
    EDATE(A1,1)
    There is, as it turns out, more than simplicity in favor of Yvan's approach. While one might expect the two formulas always to produce the same results, they do not! This is easily seen by constructing the following three column table with a column header:
    1. In cell A2, enter the last day of the first month of this year (January 31, 2008 in the U.S. system, for example). In the cell below it, enter the last day of the second month of this year (Feburary 29, 2008, for example).
    2. Next, select both cells & use the circular fill handle, drawing down to fill the column with a year or so of last-day-of month values.
    3. Select cell B1 (a header cell) & enter in the formula bar & press return:
    =DATE(YEAR(A),MONTH(A)+1,DAY(A))
    4. Likewise, in cell C1 enter:
    =EDATE(A,1)
    Note that the B & C column values are sometimes the same, sometimes not. The same results occur if the "1" in both formulas is replaced with another number of months.
    What seems to be happening is the 'MONTH(A)+n' expression uses the number of days in the month of the "A" cell value as the basis for the 'n months later' calculation, which is not the convention usually used for such things as billing cycles. The EDATE formula follows the normal convention, & is thus the preferred choice for almost all uses imaginable ... unless perhaps you are the one being billed.
    This also applies to 'YEAR(A) + n' calculations.
    So, it would seem that any calculation involving the DATE(year, month, day) form with an arithmetic operator in the year or month element should be used only with great care, if at all.
    BTW, the comments about the month unit of calendar time having "no real purpose today" in http://www.cl.cam.ac.uk/~mgk25/iso-time.html may be of interest.

    I'm aware of the blue warning triangle appearing in these "overflow" situations; however, even when it does not, the results may be different -- for example, with a starting date of January 31st, adding one month in my long formula produces a month argument that is in bounds but (for 2008) yields a date 2 days later than with the EDATE method.
    I don't view this so much a bug as a consequence of the vague nature of the "n months later" or of the "month offset" concept. As the cited scholarly article points out, the concept of the months of the year are of somewhat obscure mystic origins, & there lengths were arbitrarily set, often for reasons more political than practical. Between the 1st & 28th day of any month, the concept is unambiguous -- it is the same numbered day in the other month, but for the 29th through 31st day of the month it is not, depending on the starting month.
    From what little I have been able to discover from casual research, the EDATE results are the standard more by custom than by any well-defined rule: what we mean by the offset references the first, last, or some near-the-end-of-the-month day number, whichever seems the most suitable at the time.
    I do not have Excel on my Macs, but since the functions are similar, I would be interested in learning how that application behaves with this table.

  • How to make a report to display next 18 months of data with when user select a particular month from the filter in power pivot tabular model.

    Hi,
    i have a  dimension table  with month_key having values (201201,201202,201203.......202011,202012) and month name ( Jan 12, feb 12,......NOV 20, Dec 20)  and a fact  table with columns (month_key ,measure_types, Amount)
    My requirement is to create a power pivot report  in which when a user select a month from the filter, the report should display the (selected month+18 ) month's data against each type . when JAN 12 is selected ,the jan 2012 +18 = june 2013
    , month name should be populated with months till june 2013 only .
    i tried creating calculated column"END DATE " in the fact table with  dax expression to calculate the 18th monh from the current month  as below 
    month_key END DATE
    201201       201306    
    201202       201307      
    and thought of filtering the table with month key <= ENDDATE but it is not working as expected. could you please guide me on this ? Is there any time intelligence function that serve the purpose . Iam using  excel 2010
    ..hence could not do any calculation on the report side also. please suggest .
    Thanks in advance                                                                                                                                               

    Do you need to show the measure calculated for those 18 months as a total on 1 row, or do you need to select a single month and then display on row filters 18 distinct rows?
    The first is trivial as driezl has suggested.
    The second will require a second calendar table.
    I created this example workbook for a coworker who had a similar problem. You will have to use the disconnected table as your filter and pull your related table onto the rows.
    Finally, the easiest way to deal with the sort of date arithmetic you need to do is to restructure your date table to have a series of "Sequential" fields. These fields should be the number of units of time since the beginning of your calendar.
    For example, consider a calendar starting on January 1, 2010. For January - December 2010, [MonthSequential] = 1, 2, ..., 12. For January - December 2011, [MonthSequential] = 13, 14, ..., 24, and so on, incrementing by 1 for each sequential month in time.
    Assuming you have this set up in your date tables (one related to your model - DimDate - and one disconnected - DisconDimDate) your measure would look like this:
    18 Month Measure:=
    CALCULATE( [Measure]
    , FILTER( DimDate
    , DimDate[MonthSequential] >= MAX( DisconDimDate[MonthSequential] )
    && DimDate[MonthSequential] <= MAX( DisconDimDate[MonthSequential] ) + 18
    Please review this example along with the workbook I have linked above.

Maybe you are looking for