Tabular/DAX calculation sensitive to dimension (dragged) -- is it possible?

hi All,
I would like to know if it is possible to create a calculation that will behave differently depending on the dimensions dragged on a grid, basically, I have two date dimensions and depending on which dimension is put on the rows or cols (or both!?) for the
calculation to behave differently.  
thx much for any pointers,
Cos

Hi Cos,
Personally, I don't think we can achieve this requirement for your particular scenario.
If you have any feedback on our support, please click
here.
Regards,
Elvis Long
TechNet Community Support

Similar Messages

  • Excel 2010 - Calculated Members on Dimension

    Hi
    Was wondering if there was any workaround in Excel 2010 to make these appear. My understanding is that the behaviour is unchanged from 2007.
    Does anyone know of any plans to support calculated members on dimensions in Excel?
    Cheers

    I added the following to Adventure Works and it displays in Excel 2010 if I make sure to tick the option to display calculated members from the OLAP server.
    CREATE
    MEMBER
    CURRENTCUBE.[Date].[Calendar].[All Periods].test
    AS 123,
    VISIBLE = 1 ;
    The other approach is to add a physical member to your dimension and then use a SCOPE to set the value based on an expression. This way you don't need to set the option to display calculated members.
    http://geekswithblogs.net/darrengosbell - please mark correct answers

  • Value-based hierarchy on ROLAP dimension. Is this possible and how?

    Value-based hierarchy on ROLAP dimension. Is this possible and how?
    If yes, what tool I have to use. Any simple examples?

    Based on my experience of OWB10gR2 the option to create a "Value Based" hierarchy is only enabled if you create an AW based OLAP model. If you want to create a ROLAP model then I do not think this is possible.
    Question is why create a ROLAP model when you could get better performance and more powerful analytical features by using a multidimensional model within an analytic workspace.
    Keith

  • 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

  • Different expression depending on dimension dragged

    Hi,
    I need to have a different column physical mapping expression, depending on which dimension the user retrieves.
    Example:
    I want the Fact logical column "Fact.DOLLARS" map to the physical column:
    1. SUM(CASE WHEN Dim1.ColumnA = Dim1.ColumnB then dollars END) --> when the user drags any column from the dimension1
    2. SUM(CASE WHEN Dim2.ColumnA = Dim2.ColumnB then dollars END) --> when the user drags any column from the dimension2
    Is that posible?
    Thanks in advance,
    Regards.

    I dont think this is possible out of the box since this has to be implemented primarily from the Answers interface. What would happen if both dimension1 and dimension2 are chosen? You can use IndexCol to dynamically vary the columns. You need to write a custom java script which would set the session variable based on what was chosen. But again i would not go there since that would not work in all the situations. What you can do though is create 2 measures like this in BMM. Have a calculation set in such a way that you can identify what was chosen like say multiply by 1000 and check for 3 zeroes at the end for one and multiple by 100 for the other and check for 2 zeroes at the end (just a sample. You would have to find what is suitable depending on your data). Then make a union of these 2 in your report and pivot it. And apply the filter accordingly(like filter the measure that has 2 zeroes at the end based on some presentation variable). But again not out of the box. I would be better of creating these manually in my reports.
    Thanks,
    Venkat
    http://oraclebizint.wordpress.com

  • Dax Calculating Same time previous period with nonstandard periods

    I need help dealing with prior period calculations where the periods are not standard.
    In our business we define these time periods based on 8 to 10 week periods that really have no correlation to standard weeks, months or quarters.  Additionally there may be some time between these periods that are not defined. For example:
    Period 1 (p1) = June 18 - Sept 2
    Period 2 (p2) = Sept 17 - Dec 9
    The length of the periods are variable and when one ends another does not necessarily begin.
    I need to figure out how to compare the sum of a metric in Period 2 with the sum of a metric in Period 1.
    I have a standard Date dimension. And I have a period deminsion with the period labels (p1, p2 etc.) the start date, the end date of the periods, and a column called previousPeriod that has the label of the prior period.
    Each Fact has a Period ID so that I can use period as a dimension.One of my measures is Sum(sales).
    I want it so that if I am viewing the Tabular cube by period, I can have the sum of sales for that period, and the prior one. I hope it is clear what I am trying to do.

    You should add to your Date table a column that contains an incremental number for each period, then write something like:
            CALCULATE
                [Sales],
                ALL
    ( 'Date' ),
                FILTER
                    ALL
    ( 'Date'[IncrementalPeriod] ),
                    'Date'[IncrementalPeriod]
                        =
    EARLIER ( 'Date'[IncrementalPeriod]
    ) - 1
    I suggest you this pattern that will be published on March 31 - it contains many more examples, including how to write the make this formula working also with a partial arbitrary selection of days in the selected period:
    http://www.daxpatterns.com/time-patterns
    Marco Russo http://www.sqlbi.com http://www.powerpivotworkshop.com http://sqlblog.com/blogs/marco_russo

  • SSAS Tabular: Show balance on latest dimension attribute

    Hi,
    I have a fact with transactions over time eg.
    20140101, 1000
    20140105,-400
    In SSAS Tabular, I want to add a balance (saldo) measure, that shows the balance on any given date from my date dimension
    Balance 20140106: 600
     I can do this by using SUMX (or summarize)
    Saldo:=SUMX(
    VALUES('Date'[Date])
    ,CALCULATE(
    SUM(Fact[Amount])
    ,DATESBETWEEN('Date'[Date],BLANK(),LASTDATE('Date'[Date]))
    ,ALL('Date')
    The issue arises when I want to show the balance for an attribute from a dimension related to the latest fact entry. I can calculate this on dates that has transactions like this:
    Saldo_MaxFact:=MAXX(
    VALUES('Fact'[FactId])
    ,CALCULATE(
    SUM(Fact[Amount])
    ,DATESBETWEEN('Date'[Date],BLANK(),LASTDATE('Date'[Date]))
    ,ALL('Date')
    ,ALL('Fact'[FactId])
    ,ALL('Dimension')
    But on dates with no transactions, this measure is empty (which makes sense, since there is no FactId to roll-up the sum to).
    How would I go about creating a measure that rolls up to any given date AND the attributes on the latest fact entry?
    I have created a sample snapshot: http://1drv.ms/1ly4o6a
    Sample Excel Power Pivot model: http://1drv.ms/1jy2nkX
    Any help would be much appreciated!

    Hi Greg,
    Finally I found the problem why the query goes out of memory in tabular mode. I guess this information will helpful for others and I am posting my findings.
    Some of the non-key attribute columns in the tabular model tables (mainly the tables which form dimensions) do not contain pretty names. So for the non-key attribute columns which I need to provide pretty names I renamed the columns to something else.
    For an example, in my date dimension there is a non-key attribute named “DateAltKey”. This is the date column which I am using. As this is not pretty to the client tools I renamed this column as “Date” inside the designer (Dimension
    design screen). I deployed the cube, processed the cube and no problem.
    Now here comes the fun part. For every table, inside the Tables node (Tabular SSAS Database > Tables) you can view the partition details. You have single partition per dimension table if you do not create extra partitions. I opened the partitions screen
    and clicked on the “Edit” icon and performed a Syntax Check. Surprisingly it failed. It complains about the renamed column. It complained “Date” cannot be found in source. So I realized that I cannot simply rename the columns like that.
    After that I created calculated columns (with a pretty name) for all the columns which complained and all the source columns to the calculated columns were hid from the client tools. I deployed the cube, processed the cube and performed a
    syntax check. No errors and everything were perfect.
    I ran the query which gave me trouble and guess what... it executed within 5 seconds. My problem is solved. I really do not know who did this improve the performance but the trick worked for me.
    Thanks a lot for your support.
    Chandima

  • SSAS Tabular DAX- Need to get MAX value of the MIN (top)hierarchy level row

    EDIT:
    I got closer to resolving the issue using MAX. 
    However, If I remove the department hierarchy and just place on the MAX measure I get the single largest value out of all departments. 
    It would be ideal if the measure could still SUM the "top level" values across everything in the system if the hierarchy is not placed on the rows grouping.
    So it returns the largest value for a given department, but if the department hierarchy isn't present I need it to return a SUM of all the level 1 values for all departments...
    Basically return MAX value from the MIN L1ID's DeptLevel value, but I can't seem to construct that DAX query.  So if DepartmentID hierarchy is on display it gets MAX per row, but if that is removed it dips into MAX GoalValue for each L1ID grouping with
    the MIN DeptLevel.
    /EDIT
    I have a rather odd data table I'm bringing into a SSAS Tabular model.
    Instead of having all data at each child level and then it adding up to a grand total in the parent, it has a grand total predefined at each child level.
    I just need this tool to display the raw data if at all possible instead of trying to aggregate everything. Filter on active level, ignore child levels.
    Is there a way to do that?
    Example:
    SalesGoalsByDepartmentLevel:
    Level1 (top level) = 5,000
    Level2( lower level) = 0
    Level3(lower still) = 500
    Level 4(lowest) = 4,250
    So note that adding up all the child levels is still $250 shy of the top 5,000.
    IT is just an odd business rule, basically each level is expected to meet that goal or exceed it, the top level goal is 5,000 but management doesn't care where that last 250 comes from, they do are that each defined level is met.
    These levels are in a hierarchy so if I view the top level of the hierarchy it adds up to 4250+500+5000=9750 when I just want to see 5,000 at the top level and the details when they drill down.
    I added a filter to just filter to the top level, but then when I drill down of course those lower levels are blank.
    Is there a way to filter on the current displayed level without aggregating all child levels?
    Thanks!

    You might want to take a look at the Parent-Child Hierarchies pattern here:
    http://www.daxpatterns.com/parent-child-hierarchies/
    You might write DAX code to check what is the "current" level (see BrowseDepth measure in the sample file you can download) and depending on its level, se the filter to blank to all the levels below, so you don't aggregate "children".
    Just an idea, I'm not sure if it corresponds to your requirement and I don't have time to make more tests.
    I hope it will be helpful.
    Marco Russo (Blog,
    Twitter,
    LinkedIn) - sqlbi.com:
    Articles, Videos,
    Tools, Consultancy,
    Training
    Format with DAX Formatter and design with
    DAX Patterns. Learn
    Power Pivot and SSAS Tabular.

  • Tabular form calculated summary row

    Hopefully this may be a quick question with either a yes or a no
    I have a tabular form with columns
    Project Name , Wk1 , Wk2 , Wk3 etc ,
    basically so PM's can track the hours against a project
    I have used the sum checkboxes to create a summary row
    but they also want a row that calculates how many hours remaining for each week under the week no cols , obviously subtracted ffrom the hours budget for each week assigned to the project and person
    I've done the summary and calculation in a view but this isn't acceptable as a UNION query in a tabular form
    I've also tried another region under the Tabular form but as the project name is a variable length its not easy keeping the Wk cols aligned
    thanks in advance
    Chris

    Hi Gus/Paul,
    I had the same requirements as you, resulting from the fact that newly added rows may not be visible to the user until he/she has scrolled down sufficiently, but, by lowering my standards (something I excel at :D ), I was able to find an acceptable compromise.
    As you probably noticed yourselves, when you "edit" the ADD button, you can see that a call is made to the addRow() javascript function. I therefore took a look at the javascript code - foolish really as I am an oracle DBA from the Jurassic period. Needless to say it scared the pants off me... So, fuelled by cowardice, I snatched at an inferior-but-dead-easy-to-implement alternative solution whereby the page is automatically "scrolled" to the bottom of the form when the "ADD" button is clicked.
    Should this "cop out" work for you, you can implement it in the following way:
    1. Create a new HTML region immediately after the tabular form, containing the following source: <font color="blue">&lt;a name="bottom_of_page"&gt;&lt;/a&gt;</font>
    2. Amend the action when the "ADD" button is clicked to scroll down to the new region by doing the following:
    - edit "ADD" button
    - Go to "Action when button Clicked" section
    - Amend "URL Target" from
    <font color="blue">Javascript:addRow();</font>
    <br>to
    <font color="blue">Javascript:addRow();window.location='#bottom_of_page'</font>
    <br>
    <br>Regards,
    Amr.

  • DAX Calculation shows incorrect results when driven from Time Slicer

    Hi,
    We have defined a DAX quarter on quarter calculation  
    PREV Q % 13F:=divide([PREV Q ABS 13F],[Prior Quarter 13F])
    Prior Quarter 13F:=CALCULATE(sum([TotalValue]), DATEADD(Time[Date], -1, QUARTER))
    PREV Q ABS 13f:=CALCULATE(sum([TotalValue]))-[Prior Quarter 13F]
    which works fine in Pivottables in Excel but when time selection is driven by a time slicer the calculation doesn't work anymore:
    Is this a but or expected behaviour? Are there other ways to use a control that affects multiple other pivot tables like the time slicer?
    Thanks for your help!
    Martin

    OK, there are some really interesting points here - i think the screenshot below best explains it:
    Time Slicers use MDX subselects to propagate the selection to the pivot table:
    SELECT .... FROM (SELECT Filter([Fact13FSample].[ReportDate].Levels(1).AllMembers, ([Fact13FSample].[ReportDate].CurrentMember.MemberValue>=CDate("2013-04-01") AND [Fact13FSample].[ReportDate].CurrentMember.MemberValue<CDate("2013-07-01")))
    ON COLUMNS  FROM  ...
    this works just fine for normal measures but seems to cause issues with time-intelligence function
    it actually causes an issue with all calculations that use CALCULATE and thereby shift the context out of the subselect
    it seems that you cannot get out of this context using DAX- at least i could not find a solution yet
    not even this works:
    All Quarter 13F:=CALCULATE([SumTV], ALL('Time'))
    the result is always limited to the subselect :/
    funny thing is that this only seems to happen with this specific subselects so i guess it is further related to MDX FILTER() or .MemberValue or CDATE()
    the only option i could currently think of is to use regular slicers
    Gerhard Brueckl
    blogging @ http://blog.gbrueckl.at
    working @ http://www.pmOne.com

  • Trailing 4 quarters DAX calculation on an aggregated level

    Hi,
    I am having difficulties with the calculation of the last 4 quarters in DAX. I am using a standard fact table and a separate time table (Time). The calculation works fine on the quarterly level but I can't find a way to display the correct results on a total
    year level.
    My calculation is as follows:
    Dividends TTM:=CALCULATE([Dividend], 
    DATESBETWEEN(Time[Date],
    DATEADD(FIRSTDATE(time[date]),-3, QUARTER),
    LASTDATE(time[date])))
    Thanks a lot for your help!

    So I think it's actually returning 4 Quarters and 1 day which you could fix with something like the following:
    Dividends TTM:=CALCULATE([Dividend], 
    DATESBETWEEN(Time[Date],
    DATEADD(DATEADD(LASTDATE(time[date]),-4, QUARTER),1,DAY)
    LASTDATE(time[date])))
    http://darren.gosbell.com - please mark correct answers

  • Tabular DAX Query for MINX, MAXX and AVGX

    Hi,
    I need to create three measure to get value of min, max and avg.
    For example, I have 3 columns in my table. I need to take minimum value of Column3 based on column2. If column2 value is 0, then we have to consider entire table data else only we have to consider
    Column1 Column2 Column3
    AAA         1      150
    BBB         1       50
    CCC         0       25
    DDD        1        40
    EEEE        0        70
    I need to take minimum,maximun and avg value of Column3 based on column2. If column2 value is 0, then we have to consider entire table data. IF column2 value is 1, then only we have to consider the row of column2=1.
    I expect the result as like below. Can you please help to find the DAX query for the measure.
    Column1 Column2 Column3  MinValue
    AAA         1      150            40
    BBB         1       50             40
    CCC         0       25             25
    DDD        1        40             40
    EEE         0         70            25
    EEE         0         70

    Hi,
    I have 3 columns in my table. I need to take minimum value of Column3 based on column2. If column2 value is 0, then i have to consider entire table data else only i have take minimum(column3) by considering rows of column2=1.
    Column1 Column2 Column3
    AAA         1      150
    BBB         1       50
    CCC         0       25
    DDD        1        40
    EEEE        0        70
    Try1:
    Min:=IF(Column2>0,MINX(FILTER(table,[column2]>0),[column3]),Min(Column3))
    Try2:
    Min:=MINX(IF(Column2>0,FILTER(table,[column2]>0),table),[column3]))
    Try3:
    Created Measure called Min1.
    Min1:=MINX(FILTER(Table,[Column2]>0),[Column3])
    And then i made this min1 measure to be hidden.
    Created another measure called Min2.
    Min2:=IF(ISBLANK([Min1]),MIN([column3]),[Min1])
    Both DAX query is not working. Can anyone help to have the correct DAX query to create Min measure based on the conditions.

  • Row Calculation (Navigation Ragged Dimension)

    Hello,
    I have a row calculation/navigation question with the Olap Analysis product in 4.1 compare to 3.1.  Currently we are in BOE3.1 but want to go BI4.1.
    We use SSAS 2008 as the main source for OLAP.  In 3.1 when we don't want to see a member (in this case central), we de-select it from
    the members list, the total remain the same.  In 4.1 we cannot do that anymore.  If we de-select central from the members list,
    the total re-calculate as depicted by the example below.  Basically the row column become a filter. Is there a option for this so the data doesn't recalculate.  We want the same behavior as 3.1
    On a related note. The navigation on the slice and dice in analysis is more cumbersome in 4.1, you always have to go the the layout
    to change filter.  Is there a way to make it more similar to 3.1. Less clicking
    Region
    Total Count
    Total sales
    All Region
    6
    60
        East
    1
    10
        Central
    2
    20
        West
    3
    30
    In Voyager
    Region
    Total Count
    Total sales
    All Region
    6
    60
        East
    1
    10
        West
    3
    30
    Olap Analysis
    Region
    Total Count
    Total sales
    All Region
    4
    40
        East
    1
    10
        West
    3
    30
    Thanks
    rs

    Hi Ian,
    Thanks for the response? What is best way to contact you We don't have direct support with SAP. We go through a 3rd party.  Thus I want some information before contacting them.
    -rs
    Message was edited by: Tammy Powlas > please note do not include e-mail addresses in SCN per rules of engagement. Ian gave you his contact information above - Ian.McAlpine at sap dot com

  • Complex DAX Calculation

    Hi,
    I have an excel calculation that I have tried to convert i into a powerpivot measure. The excel calcualtion is as below:
     (IFERROR(IF(1-ABS((TOTDEMANDQTY-REVISEDFRC)/TOTDEMANDQTY)<0,0,(1-ABS((TOTDEMANDQTY-REVISEDFRC)/TOTDEMANDQTY))),"0.00")
    I was given some great advice to change it to the below as a measure and it almost works but not quite:
    Some Measure:=if(DIVIDE(ABS(FAReportInput[Demand]-FAReportInput[Revised Forecast]),FAReportInput[Demand],0)<1,1-DIVIDE(ABS(FAReportInput[Demand]-FAReportInput[Revised Forecast]),FAReportInput[Demand],0),0)
    The issue is where I have a revised forecast of an amount but a demand of zero I am returning a value of 1 when in fact it should return a value of zero as per the iferror in the excel formula- can anyone help?
    Thanks

    Hi Grinch,
    Glad to hear that your issue had been solved by yourself. Thank you for your sharing which will help other forum members who have the similar issue.
    Regards,
    Charlie Liao
    TechNet Community Support

  • AWM dimension mapping - is it possible to load data from two input tables ?

    Hello All
    I have two tables ProductFamily (parent level) and Products (child level).
    I want to load a dimension from these two tables where the parent-child relationships are maintained (I am using AWM).
    I created a mapping with these two tables as input, but the data loaded does not maintain the relationships.
    So how do I do that? Is it possible to load dimensions where different levels get data from multiple tables?
    Is there any type of joiner available in AWM?
    thanks
    Few Notes:
    - I do not want to use OWB here as my data is clean
    - In AWM, When I loaded the data from a single view which contained data from both input tables, it worked fine. But this is my worst case option.

    You should use the Snowflake Dimension option in the Dimension mapping screen for the Product Dimension (as opposed to the default dimension mapping style - star schema).
    This will modify the mapping inputs to include a separate parent level key for each hierarchy/level i.e. for each hierarchy/level (unless topmost level of hierarchy), you need to specify the parent level key in addition to the current level key, code/name/description/other attributes etc.
    You can do the mapping in either .... use icons at the top of the mapping screen.
    the drag/drop mode by dragging the relational column onto dimension model - hierarchy/level/attribute
    -or-
    the table expression mapping mode which gives the same effect.. dragging a column onto an attribute sets the expression in <schema>.<table>.<column> format.
    HTH
    Shankar
    Note1: Complete the mapping in one go.. Switching b/w the mapping modes cause the mappings to be reset.
    Note2: Assume your data is correct, foreign key to parent level table: ProductFamily exists in child level table: Products.

Maybe you are looking for