FORECAST - Using Dax formulas

Hi, I am trying to build a forecast model that will enable me to my companies future orders.
I have created the following Tables:
1. DATA - import from Access - It contains last 3 years monthly sales per product
2. DATE TABLE - I use it as a calendar
3. Forecast Table - List future forecast per product code
4. Actual Sales Table - Display current sales
5. PRD Range - Display all PRD Code
I had built also the following relations ships:
1. Data Table - linked to Date Table, Forecast Table, and Prd Range
2.Actual Sales - linked to PRD Range and Forecast Table.
I am planning to add also:
Stock Table
Orders Table
I find it difficult to calculate Mean Absolute Error and general how to set up the whole model.
Any ideas how i can progress with this?
Thanks.

Hi Panteli,
According to your description, you are going to create a forecast model so that you can forecast the company's future orders, right?
We can create a forecasting model by using a combination of basic PowerPivot and Mining Plugins for Excel 2013, please refer to the links below to see the details.
http://blogs.msdn.com/b/data__knowledge__intelligence/archive/2013/06/18/forecasting-sales-data-with-excel-mining-step-by-step-guide.aspx
http://www.powerpivotpro.com/2014/05/forecasting-in-power-view-and-power-bi/
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • Using IF or SWITCH functions inside a DAX formula into a tabular model - SSAS 2012

    Hi,
    in a tabular model I've changed a DAX formula introducing the SWITCH function, but when I deploy the changed formula and open the Excel workbook the slicer connected to the pivot table doesn't highlight the slicer values involved as instead of old formula.
    Any suggests to me in order to maintain the right behaviour for the slicers when a formula is re-written using an IF/SWITCH functions, please?
    Thanks

    I think that is the default behaviour and I can find a few justifications for it too...
    For eg, if you have a complex IF condition, the measure will have to be evaluated for each value of the slicer for correctly finding the right values in the slicer to highlight, and that can make it REALLY slow.
    Also, sometimes there is no correct values to highlight. For eg, if I have the products in the slicer and have a condition like
    =IF(HASONEVALUE(Product[Product]),1)
    then which Product should be highlighted? There is no correct value as any one of the Product selected on it's own will display value for the measure. And more than one products selected will display no value. So no matter what you display/highlight on the
    slicer, there is no "correct" behaviour. In such a case, it is best left to display/highlight all values.
    Cheers,
    Jason | www.SqlJason.com
    P.S. : Please click the 'Mark as Answer' button if a post solves your problem! :)

  • SSAS DAX formula for same period last year not same month last year

    The DAX function sameperiodlastyear, only works if the period we are interested in, is the same as a month.
    However our Period 3 for 2014 was 05-march to 04-April and Period 3 in 2013 was 01-March to 31-March
    I have a dim_Date table with a separate Year Number and Period Number so you be able to match on Period Number and Year - 1
    The sort of formula I am after is this, so that the P3 total for 2013 matches the value reported as 'PY' against P3 2014
    so for example
    PY:=calculate(sum(amount), dim_date(year) = dim_date(year-1) && dim_date(period) = dim_date(period)
    I cannot find an exact example of how to construct the DAX formula to achieve this.
    I have tried DAXPatterns.com, but that does not have an exact example.
    Thanks in advance
    Sotn

    All built-in time intelligence functions work on the standard Gregorian calendar. The only fiscal calendars that can be handled by the built-in functions are those that end on another day than December 31, but otherwise respect the standard months/quarters.
    The problem you are encountering in your [PY] is that CALCULATE() only allows simple boolean predicates (no calculations allowed. FILTER() is the function that allows you to execute arbitrary logic in your CALCULATE() filter arguments.
    Try this:
    PY:=
    CALCULATE(
    SUM( <fact table>[amount] )
    , FILTER(
    ALL( dim_date )
    , dim_date[year] = MAX( dim_date[year] ) - 1
    && dim_date[period] = MAX( dim_date[period] )
    Here's what's going on in that FILTER(). FILTER() is an iterator - it steps row-by-row through the table that you pass as the first argument, and returns only those rows that meet the criterion you set in the second argument.
    We pass ALL( dim_date ). This strips the current filter context from the pivot table and returns every row of dim_date.
    In the second argument to FILTER() we define the logic that will determine which rows to return. This comes in two parts, connected with the logical and operator, &&. I will only explain one in detail as we're using the same pattern in each part.
    dim_date[year] is referring to the value of the column [year] based on where you are in the table (remember, FILTER() is stepping row-by-row through), so will return one value from the current row based on FILTER()'s iteration.
    It then compares that value to what is returned by MAX( dim_date[year] ) - 1. This expression is not evaluated in the current row context of FILTER(), rather in the filter context of the pivot table (in a pivot table your row and column labels are referred
    to as rowfilters and columnfilters - this nomenclature can get confusing). Thus, it returns whatever the current year of the pivot table is and subtracts one. When the value of [year] in dim_date matches the value returned by this expression, that row is part
    of the set returned by FILTER().
    Once FILTER() has completed its iteration, it returns the filtered table, and that table is used to set the filter context that SUM( <fact table>[amount] ) is evaluated in.

  • Filtering data already filtered using DAX

    Hi there
    I am using DAX to calculate the count of instances in a filtered table
    e.g.
    =CALCULATE( COUNT(Table[Tariff] ,
    FILTER( Table , Table[Tariff] > 0 )
    This part of the code works fine. My trouble arises when I am trying to filter the table that I have already filtered:
    =CALCULATE( COUNT(Table[Tariff] ,
    FILTER ( FILTER( Table , Table[Tariff] > 0 ) , Table[Tariff] = MIN(Table[Tariff]) )
    In the above calculation, I want to 
    1. Filter out the tariffs that are greater than zero [this bit works fine]; and then
    2. Take that table filtered from 1. above and further filter that by extracting only those tariffs that are equal to the minimum in that data table [this part isn't working].
    Instead of doing what I need it to, this formula is treating the outer FILTER in the same manner that it would be treated if I had only one filter. Thus, as zero is the minimum in the unfiltered data set it is only returning all the zero tariffs - even through
    I filtered these out already.
    If anyone can please assist, it would be much appreciated.
    Cheers
    Andrew

    Hi Andrew,
    Something along these line may work...
    =CALCULATE(
    SUM(TariffData[Tariff])/COUNT(TariffData[Tariff]),
    FILTER(
    FILTER(
    TariffData,
    TariffData[BEGIN_DATE_INDEX] <= [Date_Count]
    && TariffData[END_DATE_INDEX] >= [Date_Count]
    TariffData[Tariff_Duration] = CALCULATE(
    MIN(TariffData[Tariff_Duration]),
    FILTER(
    TariffData,
    TariffData[BEGIN_DATE_INDEX] <= [Date_Count]
    && TariffData[END_DATE_INDEX] >= [Date_Count]
    ...But it's likely that you'll need to adjust the inner most CALCULATE to get the right behaviour due to the filter context transition. If you're able to provide some test data and details of how the data has been modelled, we should be able to arrive at
    a solution that definitely works.
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com
    Blog: http://www.nimblelearn.com/blog
    Twitter: @nimblelearn

  • DAX formula/measure problem

    Dear excel champions
    My problem is to find the DAX formula decribing distribution ratio.
    Distribution ratio should be calculated as: (based on data below)
    Distribution ratio= avg(Number of Visits Where product is available in ALFA stores / Number of Visits where product should be available in ALFA stores , Number of Visits Where product is available in BETA stores / Number of Visits where product should be available
    in BETA stores) = avg(4/8,3/4) = 62.5%
    The fact which complicate this calculation is ALFA stores visited more than once.
    I tried everything and could not find the solution.
    I hope someone manage to help me with this task 
    Table. 1                                                              
    Client   
    Product ID          Visit date           
    Number of Visits where             
    Number of Visits Where
    product should be available          product is available                                  
    ALFA     aaa        
    02.12.2013         
    1            
    ALFA     bbb       
    02.12.2013         
    1            
    1
    ALFA     ccc         
    02.12.2013         
    1            
    1
    ALFA     ddd       
    02.12.2013         
    1            
    1
    ALFA     aaa        
    15.12.2013         
    1            
    ALFA     bbb       
    15.12.2013         
    1            
    1
    ALFA     ccc         
    15.12.2013         
    1            
    ALFA     ddd       
    15.12.2013         
    1            
    BETA     aaa        
    16.12.2013         
    1            
    1
    BETA     bbb       
    16.12.2013         
    1            
    1
    BETA     ccc         
    16.12.2013         
    1            
    BETA     ddd       
    16.12.2013         
    1            
    1
    Anyone helps? What function should I use: calculate, average, averagex, summarize, filter, count, countx, earlier, sumx, discount, countrows?
    I do not know which ones are appropriate and how to join them in a one formula/measure.
    thx for any posts

    Great job Marco :)
    It' working!
    In a final formula we need to replace divided sums:
    avg :=
    AVERAGEX (
        VALUES ( Tablename[Client] ),
        CALCULATE (
            SUM ( [Number of Visits where product is available] )
     SUM ( Tablename[Number of Visits where product should be available] )
    Simple but made me frustrating

  • How to get field data using a formula

    I have a table with fields ‘pension contribution’ and ‘current year’.The first field stores a single record for a given year.Say if ‘current year’ is 2014 ‘pension contribution’ is 7% and so on.
    I wanted to get a result by providing a certain year from another field in a table using a formula.
    How do I do this?An explanation would be helpful.

    Hi Nebil,
    You can't! You'll need to join the the two tables or use a Subreport.
    -Abhilash

  • Can I use a formula node to start the execution of a case structure?

    Hi,
    I am working on editing a VI to make it much easier to understand (for colleagues and non LV users). For one reason or another, the VI's creators did not fully make use of the power of case structures and other structure types. In the application we need it for, the instrument cycles and repeats measurements on several objects. We are interested in measuring the motor currents for several motors in the system. As it stands now, for each sample object's run, there is a separate sub-vi diagram which displays its waveform trace and several indicators such as max current, time at max, etc. That code was contained within a T/F case structure and copied and pasted 20 plus times.... Obviously the vi became extrememly cluttered and needed a huge screen to see. The trigger for the current case structures is an EQUALS comparison between one input (which is the sample object counter; and this part I will likely leave unchanged since it makes a lot of sense already) and a constant which was defined 1 through 20+ for case. 
    I have since made one case structure and 20+ instances of that case and have labeled them (at the top selection box near the detent arrows) "1", "2", 3, etc. I am wondering if I can use a formula node to act as the "trigger" which sets each case structure running? I believe that a simple IF statement should work. Please see a snippet of my attempt at making this in C below.
    For the node, I defined X as the input and Y as the output. The input to the node, X, is connected to the sample object counter. The output, Y, is connected to the case selector of the case structure. My attempt at the code is below:
    int32 y
    For(x == 1)
       y = "1";
     For(x == 2)
       y = "2";
    etc, etc.
    Is that above code snippet correct? Do i need something like "ENDIF" or "end if" at the end? Does "y" have to be defined as "int32" or can it be something else?
    Thanks for the help!

    Is your formula node doing anything else besides what is shown?
    Why don't you just wire the value that is going into it at X directly into the selector of the case structure?
    Attachments:
    Example_VI_BD.png ‏2 KB

  • If then Else using DAX Calculation

    Hi all, new to DAX. I am trying to replicate a Oracle SQL column using DAX functions in SSAS Tabular.
    My Oracle column is defined like below:
    If STATE_CODE Not in('A','B','C','D') 
            And Not (substr(PK_ID,4,2) = 'XY' And DIV_CODE in('YU','SD')) Then
             CNT = 1;
          Else
             CNT = 0;
    Any ideas how to start? Should i use DAX Switch function ?
    Thanks,
    TAG

    We have IF and Switch Function Available in DAX .
    You can use any of one.
    IF(logical_test>,<value_if_true>, value_if_false)
    For Switch you can use below;
    SWITCH(TRUE(),
    booleanexpression1, result1,
    booleanexpression2, result2,
    else
    Just create calculated column in Cube and add this logical IF/Switch function there.
    Or If you want to calculate this at query level using DAX then you can follow below Query.
    Evaluate
    ADDCOLUMNS
    TableName,
    , "calculated column"
    ,IF( Logical,Truecondition,False Condition)
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

  • I need to get 2 decimal places when using a formula for a quotient and Numbers will only give me whole integers which is useless since most items will be less than 1. How can I change this?

    How do I get 2 decimal places when using a formula for a quotient? It only gives me whole integers. Most of the results will be less than 1 so I need 2 decimal places

    the quotient function returns only whole number portion of the dividing two numbers.  If you want the actual decimal value use the divide operator.  you enter this as:
    A/B
    if the numerator is in A1 and the denominator is in B1 you can enter the formula like this:
    =A1/B1

  • How to use a Formula Column in the main query?

    Hi All,
    I've tried to use a formula columns defined in some query in the condition of that query like this:
    where (:cf_ex - :cf_ex2) >= 5
    but when I run the report no data returned! Why? and how to use it the condition of the query?
    Note: I'm using Forms 6i

    where (:cf_ex - :cf_ex2) >= 5You cannot do that. Formula columns are not part of the select statement (which runs in the database), but are processed in the report.
    When you created this query, my guess is that you got the message "Note: the query Q1 has created the bind parameter(s) cf_ex, cf_ex2". Check these User Parameters in your data model. So, you are actually referencing user parameters in the query, not formula columns.
    I made a computations and things using PL/SQL that can't be done in the select statement in the data model!If it's pl/sql you can probably use that in your query. Create some database functions for cf_ex and cf_ex2 and use these in your query.

  • DAX formula and Legend/Series variable on line chart

    What I am trying to do is to find a DAX function that will not cumulate the 'startyear' variable (2006-2012) that is in the Legend/Series in a pivot table for a line chart I have (see below image of chart). The below functions just cause the startyear values
    to cumulate all together (2006+2007+2008....) instead of treating the years as separate values:
    =(CALCULATE(countrows(s1Perm1),FILTER(ALLSELECTED(s1Perm1),s1Perm1[ExitMonthCategory] <= MAX(s1Perm1[ExitMonthCategory]))))/(CALCULATE(COUNTROWS(s1Perm1),ALL(s1Perm1[Exit],s1Perm1[ExitMonthCategory])))
    Does anyone know how to change the above DAX formula or have another one that will allow the values in the Legend/Series variable to cumulate individually?

    Yes, it is a count, but they also must meet the criteria in the slicers chosen by the user.
    Regardless, I tried your suggestion and unfortunately, it did not work--in that the year values in the Legend/series are still aggregating together, rather than individually--ie. the numerator below for 2007 and 2007 are combined:
    StartYear
    Values
    2006
    2007
    ExitMonthCategory
    Den
    Num
    CumPercent
    Den
    Num
    CumPercent
    0.5
    243
    30
    12.3 %
    168
    30
    17.9 %
    1
    243
    37
    15.2 %
    168
    37
    22.0 %
    2
    243
    53
    21.8 %
    168
    53
    31.5 %
    3
    243
    63
    25.9 %
    168
    63
    37.5 %
    4
    243
    75
    30.9 %
    168
    75
    44.6 %
    5
    243
    92
    37.9 %
    168
    92
    54.8 %
    6
    243
    104
    42.8 %
    168
    104
    61.9 %
    12
    243
    175
    72.0 %
    168
    175
    104.2 %
    18
    243
    218
    89.7 %
    168
    218
    129.8 %
    24
    243
    262
    107.8 %
    168
    262
    156.0 %
    30
    243
    289
    118.9 %
    168
    289
    172.0 %
    36
    243
    302
    124.3 %
    168
    302
    179.8 %
    42
    243
    306
    125.9 %
    48
    243
    309
    127.2 %
    168
    309
    183.9 %
    54
    243
    318
    130.9 %
    168
    318
    189.3 %
    60
    243
    320
    131.7 %
    66
    243
    321
    132.1 %
    72
    168
    324
    192.9 %

  • Can you use a formula field as the default value of a parameter?

    I'm wondering if you can use a formula field as the default value of a parameter. I have an date parameter that is being pulled from a stored procedure. When I run the report, it defaults to the current date and time. I would like it to default to he current date and have the time be 00:00:00

    Hi,
    Unfortunately, you cannot use a formula field as the default value of the parameter.
    And, to get rid of the current time and show 00:00:00, all you need to do is Edit the parameter and set the 'Default Value' to 00:00:00. This will take care of the time portion, however the date portion would be set to the year 1899 and not the current date.
    Hope this helps!
    -Abhilash

  • How can I convert from Modbus raw data to engineering units using a formula?

    Within Lookout, I have several Modbus numerical input types that do not have a linear corespondence to the Engineering values they represent.  How can I display these values accurately using a formula to convert from the raw data to an engineering value?

    I don't quite understand your reply.  I'm using Lookout 6.0.2, logged in as Administrator, in Edit Mode.  The Modbus object is named RTU06_SAV.  The Active member is 30002 with an alias of SAVfmSMT_RSL.
    Following your instructions, I opened Object Explorer and right-clicked on RTU06_SAV. 
    This opened a menu containing:  Refresh, Cut, Copy, Rename, Delete, Edit connections..., Edit Data Member Configuration, Configure Network Security and Properties.
    I assumed that I should select Edit Data Member Configuration, but maybe I'm wrong. 
    Within Data Member Configuration I can set up Linear Scaling between Raw data and Engineering data.  I know how to do that, but what I need to know is how to convert Raw data to Engineering data using a formula representing a non-linear transformation (such as a converion to a logarithmic value or perhaps a formula derived by fitting the formula to a curve on a calibration chart).
    Once I have this my Engineering data can be represented on a control panel as both a numeric value AND as a correctly reading Gauge.  It can also be properly represented on a HyperTrend graph.
    What do you suggest?

  • SSRS Use a formula for a line graph y = mX + b

    Hi I want to show a line on a line chart using a formula in the form y = mX + b.   Can't seem to get this to work.   I inputted the formula into the "Value field" of the "Data field" but the line doesn't show up.
    X = value for X axis (it's a date);  m and b are query fields (both type real)    The data is grouped on two fields that are specified in the "series field"
    There are multiple values for X but only one value for M and B.
    So for all dates (X) for each Group 1 AND Group 2 combo: chart this line.
    Using: SSRS Visual Studio 2008

    Hi 317704,
    Linear Regression line might be what you need, you have to get the records in the database using the T-SQL for all the points on the X-Axis following the below formula. Where n is the total number of data points, and the tis and yis are the components of
    the data point tuples (ti, yi).
     I give a sample below,
    My datasource(AdventureWorksDW2008):
    DECLARE @start_month
    SMALLDATETIME
    DECLARE @end_month
    SMALLDATETIME
    SET @start_month
    = '2002-01-01'
    SET @end_month
    = '2002-12-01';
    SELECT
    CAST(CONVERT(CHAR(6),DimTime.FullDateAlternateKey,112)
    + '01'
    AS
    SMALLDATETIME)
    AS CalendarMonth
    ,SUM(SalesAmount)
    AS y
    FROM FactInternetSales
    INNER
    JOIN DimSalesTerritory
    ON FactInternetSales.SalesTerritoryKey
    = DimSalesTerritory.SalesTerritoryKey
    INNER
    JOIN DimTime
    ON FactInternetSales.OrderDateKey
    = DimTime.TimeKey
    WHERE DimSalesTerritory.SalesTerritoryKey
    = 9 --Australia
    AND
    DATEPART(YEAR,DimTime.FullDateAlternateKey)
    BETWEEN
    DATEPART(YEAR,@start_month)
    AND DATEPART(YEAR,@end_month)
    AND
    DATEPART(MONTH,DimTime.FullDateAlternateKey)
    BETWEEN
    DATEPART(MONTH,@start_month)
    AND DATEPART(MONTH,@end_month)
    GROUP
    BY CONVERT(CHAR(6),DimTime.FullDateAlternateKey,112)
    You could get some reference from top sample.
    Thanks,
    Challen Fu
    Challen Fu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Using Dimension Formulas to sum data based on different criteria

    Hi all,
    I am trying to use a u201CDimension Formulau201D to perform the following calculation:
    We have an account dimension which has 2 important properties:
    1.     CRITERIUMTYPE: This property can have 3 different values: u201CWERKu201D, u201CINVu201D OR u201CLIQu201D
    2.     ACCTYPE: This property can have 2 different values: u201CEXPu201D or u201CINCu201D
    The client wants to have a report that sums data based on these 2 properties. An example will help to clarify this:
    ACCOUNTS     CRITERIUMTYPE     ACCTYPE     VALUE
    ACCOUNT A         WERK                          EXP               100 u20AC
    ACCOUNT B         WERK                          INC               150 u20AC
    ACCOUNT C         WERK                          EXP               200 u20AC
    ACCOUNT D         WERK                          INC               300 u20AC
    ACCOUNT E         INV                          EXP               50 u20AC
    ACCOUNT F         INV                          INC               100 u20AC
    ACCOUNT G         INV                          EXP               200 u20AC
    ACCOUNT H         INV                          INC               500 u20AC
    The clients wishes to see this data in the following way:
    CRITERIUMTYPE     ACCTYPE     VALUE
       WERK                         EXP              300 u20AC
                                        INC              450 u20AC
       INV                         EXP              250 u20AC
                                     INC              600 u20AC
    In order to achieve this I have created several new accounts, one for each combination e.g.: Account WERKEXP is used to sum the data on the combination CRITERIUMTYPE=WERK and ACCTYPE=EXP. I have created a dimension formula in my account dimension but this is where I am stuck. I have created the following formula to calculate the account WERKEXP:
    IIF([BUDGETPOSITIE].CURRENTMEMBER.PROPERTIES("ACCTYPE")="EXP",IIF([BUDGETPOSITIE].CURRENTMEMBER.PROPERTIES("CRITERIUMTYPE")="WERK",[BUDGETPOSITIE].CURRENTMEMBER,0),0)
    The problem with this formula is the following:
    The formula will add all amounts that meet the 2 criteria mentioned in the formula, EXP and WERK, but as soon as it finds an accounts that does not match the 2 criteria it will set the account WERKEXP back to 0. I need to know if there is a way, using dimension formulas, of adding these values together without the new account being set to 0 as soon as one of the accounts it needs to check does not meet 1 of the 2 criteria.
    We are working on SAP BPC 7.5 for NW with SP04
    All help is very much appreciated!
    Kind regards,
    Stefano

    Hi,
    You can also use ParentHn property to have different grouping of accounts within the dimension.
    So in your case rather using the member formula you can have four accounts and add them in the Parenthn property for grouping it.
    1. The Solution proposed by Nilanjan is specific for a Report/IS and Performance will be good
    2. My solution will be global something similar to MDX formula, but performance may be slightly lesser than using excel function.
    Hope this helps,
    Regards,
    G.Vijaya Kumar

Maybe you are looking for