Filter Date Table (SSAS Tabular)

Hi Guys,
I'll try to define my issue as clear as possible.
Am creating a model for SSAS Tabular but I have following problem.
I have a Date Table that I want to filter depending on what the user select from another table with values like:
Today, Yesterday, This Week, Last Week, This Month, Last Month, .....
What I have tried:
(1) My Date table contains flags(columns) for each of these values. Filtering on these values is no problem. But then I have a long list of different possible flags.
(2) I created a copy of my date table but with the flags unpivoted (DateId, FlagName, Value (0 or 1))
I was hoping to be able to create somehow a relation between my date table and this table, but no success.
Also this way I would have a field that users can filter on (choose what period they want to see)
But sadly enough (2) did not work and I can not find any other way to find a solution for it.
Any help would be great.
Regards,
Sammy

In your date table, you can create different attribute for
each condition below:
1. Today, 2. Yesterday, 3. This Week, 4. Last Week, 5. This Month, 6. Last Month
So, if we consider above attributes there will be 6 different attributes with "Yes/No" Or "True/ False" Or "1/0" whatever flag.
I would suggest you to calculate these conditions in sql query which will be faster compared to calculated columns in the model.
Unfortunately, tabular model 2012 do not support dynamic set so you cannot build a single attribute with these values @server side.
I had similar question sometime back, check if you find something useful from this thread -
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/302dd796-2677-44df-a76e-b053dcd14117/ssas-tabular-model-dynamic-fiscal-period?forum=sqlanalysisservices
If this post answers your query, please click "Mark As Answer" or "Vote as Helpful".

Similar Messages

  • Related column of a fact table - SSAS Tabular

    Hi,
    I'm developing a SSAS Tabular model using a SQL Server 2012 SP 1 installation.
    For a fact table I've created some calculated columns using the DAX RELATED function. These columns not are hidden to client tools. When I deploy the project and I open an Excel workbook in order to connect the SSAS Tabular cube, in the field list I cannot
    see the calculated columns by RELATED function.
    For me, this in an issue and not a normal behaviour.
    Any suggests to me, please? Many thanks

    Hi Pscorca,
    Generally, if we create a calculated column on SQL Server tabular model database on SSMS, and then go to Model-> Process -> Process All and finish the data processing. Then when we connect the database in EXCEL, the calculated column will appear on
    the Excel. In your scenario, you cannot see the calculated columns. It’s strange behavior. However we cannot give you the detail reason for this issue base on the limited information.  Please refer to the link below which describe the detail steps about
    create a calculated column, then check whether if you missing any step when creating calculated column.
    Add Calculated Column and Measures to Tabular Model
    If the issue persists, please elaborate your production environment and the steps to create the calculated column, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Filter data table in Powershell

    Hi All,
    I have one script, where i have one datatable, from that datatable i want to get data based on one search filter. 
    #Get the excel as csv and load in datatable...
    $empTable = New-Object System.Data.DataTable;
    $empTable = Import-Csv -Path "~\Employee.csv";
    #Get only Month column from the data table...
    $empMonthTable = New-Object System.Data.DataTable;
    $empMonthTable = $empTable | Select-Object -Property "Month";
    #Sort the data table...
    $sortMonth = New-Object System.Data.DataTable;
    $sortMonth = $empMonthTable | Sort-Object -Property Month;
    #Get Unique data from data table...
    $unqiueMonth = New-Object System.Data.DataTable;
    $uniqueMonth = $sortMonth | Select-Object -Unique Month;
    #Get data from datatable with unique month...
    foreach ($monthData in $uniqueMonth)
    [string] $month = $monthData | Out-String;
    $month;
    $eachMonthData = $empTable | Where-Object {$_.Month -eq $month};
    $eachMonthData;
    Here in output of "$eachMonthData" is returning null table. But if there am putting hardcoded value like "Mar", then table is returning values.
    Could you please suggest me how to achieve this?

    can you please explain more clearly

  • Filter - data table

    Can I use Xcelsius just to show on an organised way a part of a table with filters?
    Ex.:
    Type     Team     Week     Game.Nr.     Date     Hour     Location     Homa     Gast
    BvV     CadJL     34     80226     23/08/08     10:00     A     BBC Kangoeroes Willebr - A     Basket Tongeren
    BvV     JunJL     34     80124     23/08/08     15:00     WEG     BBC Helios Zottegem     BBC Kangoeroes Willebr - A
    Comp     JunJL     35     13108092     30/08/08     11:00     A     BBC Kangoeroes Willebr - A     BBC Schelle - A
    Comp     CadJL     35     13120092     30/08/08     13:00     A     BBC Kangoeroes Willebr     BBC Geel
    Comp     CadPM     35     6101125     30/08/08     10:45     WEG     Londerzeelse Dunkers - B     Dames Willebroek
    Comp     JunJL     36     13108103     6/09/08     11:00     A     BBC Kangoeroes Willebr - A     BBC Falco Gent - A
    With the filter I want the user to select a Team and/or week  The result should be a table only matching one or both criteria

    Hi Wim,
    As you have discovered, my experience also has been that the filter selector only selects a single row.  This is also consistent with the animated help for this component.
    The following "workaround" to the limitation of the Filter Selector component will meet your requirement:
    1) Place a Combo Box component on the canvas for each of the filter criteria you require;
    2) Link the Labels property of each combo box to a cell range that contains a list of the unique values;
    3) Set the Data Insertion Type of each Combo Box to "Label" and bind to a Destination cell to receive the selected item;
    4) Define a formula cell to act as the filter key, which is a concatenation of all of the values of the Destination cells from step 3;
    5) Insert a new column at the beginning of your data table to act as the filter key for each row in the table.  Each row in this column should contain a formula that concatenates each of the cells that correspond to the columns you want to filter by;
    6) Place an additional Combo Box on the canvas.  Set the Labels property to the range of cells in the filter key column defined in step 5.  Set the Data Insertion Type to "Filtered Rows".  Set the Source Data range to all of the cells in your table.  Set the Destination Data to an area in the spreadsheet that will receive the filtered subset of rows from your original data table.  Set the Selected Item property of this combo box to reference the filter key formula cell defined in step 4;
    7) Place a spreadsheet table component on the canvas and link the Display Data property to the Destination cell range defined in step 6.
    Once you have the layout as desired, hide the Combo Box defined in Step 6 behind the spreadsheet table defined in step 7 so that the end user cannot interact with it.  This Combo Box is used as an indirect method of dynamically filtering the rows from your data table.
    One other point to keep in mind:  Xcelsius does not handle large volumes of data very well.  Depending on the number of columns in your 500 row table, you may experience performance issues, or Xcelsius may stop responding altogether.
    The above approach may seem convoluted but it achieves the desired result.
    Let me know if you need any clarification of the above technique.
    Regards,
    Mustafa.

  • Error while importing data in SSAS Tabular Model

    I am new to the concept Tabular Model in SSAS 2014.
    I am trying to create one tabular model based on Adventureworks DW 2014.
    I am getting below error while importing tables to create model.
    "OLE DB or ODBC error: Login failed for user 'ASIAPAC\CSCINDAE732028$'.; 28000.
    A connection could not be made to the data source with the DataSourceID of '98c2d415-1e84-469c-a170-2bcacd779c1a', Name of 'Adventure Works DB from SQL'.
    An error occurred while processing the partition 'Customer_65240c88-55e7-416c-a7ac-732dece8be8e' in table 'Customer_65240c88-55e7-416c-a7ac-732dece8be8e'.
    The current operation was cancelled because another operation in the transaction failed."
    But while creating the Datasource, it has created successfully (below img)
    But while importing the facing the below error.
    Note:
    I have multiple instances in my system with unique names.
    Is this causing any ambiguity issues in selecting right instances?

    Hi Naveen,
    Based on your screenshots, you fail to open a connection to the data source. Right?
    In this scenario, the first screenshot you post is for creating a connection to server with the current windows authentication, not for connecting a data source. So the "Test Connection succeed" means your current windows user can connect
    to server, not connect to the database your selected in the dropdown list. Then you click next, you can choose account to access the data source. Based on the information, your service account "'ASIAPAC\CSCINDAE732028$" doesn't have permission to
    access the database you selected. Please grant the permission for the service account in SSMS.
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
    If you have any feedback on our support, please click here.

  • Unable to import data in SSAS Tabular Project

    I am using SQL Server 2012 Enterprise edition.
    I installed one instance of SQL server in Tabular model in addition to the one installed in multi dimensional mode .  
    I Attached AdventureWorks2012DW database through SSMs and it worked .
    Then I created a Tabular Analysis project,attached a AdventureWorks2012DW Database,specified tables to include (FactInternetSales and related table) and clicked finish.But the data could not be imported.
    Can anyone help? 

    Hi Somesh420,
    In a tabular project, we can import data by using Table Import Wizard in SQL Server Data Tools. Connect to the database, select data, preview, and filter the data, and then import the data into your model workspace. Here is a tutorial about how to create
    a tabular database. Please refer to the follow link.
    Tabular Modeling (Adventure Works Tutorial)
    If the issue persists, please post the detail error message and describe the steps you did, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSAS Tabular - Merge data from two tables to one

    Hi,
    I have two ReportServer databases in two different instances of SQL Server. I want to extract the ExecutionLog3 data to a Tabular model. Now, I have two separate tables in Tabular with duplicated measures but I want to have the data from two ReportServer in
    the same table.
    Any idea?
    Regards.

    Hi Numero4,
    According to your description, there are two Reporting Services databases, and you want to merge the data in a tabular model, right? 
    As per my understanding, you can create a link server on one of the server, and then merge the data in database lever other than in tabular mode. In this case, import the merged data into the tabular model. Here are some useful links for you reference.
    http://msdn.microsoft.com/en-IN/library/ff772782.aspx
    http://support.flexquarters.com/esupport/index.php?/Default/Knowledgebase/Article/View/2458/52/how-to-create-link-server-with-ms-sql-200520082012-64-bit-using-qodbcqremote
    Regards,
    Charlie Liao
    TechNet Community Support

  • Dynamic security using Security table in SSAS Tabular model

    Hi, 
    Platform : SSAS Tabular model (VS 2010)
    I need to apply Dynamic security using Security table(manually created) in Tabular model, Need to apply filter for 2 tables. I am able to
    create roles in Tabular model using USERNAME() and LOOKUP() function it worked fine. But the problem is when i am trying to give full access for a particular column and limit the access in other column, it is not working properly.
    Please find below table and guide me where i am falling short. In the Security table wherever you find ALL it means full access.
    Security table
    Login Name
    Dim_Country
    Dim_Customer
    DOMAIN\User1
    ALL
    2
    User1 should see all countries but Only 2,4 Customers
    DOMAIN\User1
    ALL
    4
    DOMAIN\User2
    2
    ALL
    User2 should see all customers but Only 2,3 countries
    DOMAIN\User2
    3
    ALL
    DOMAIN\User3
    ALL
    ALL
    User3 should see all Customers and Countries
    DOMAIN\User4
    1
    3
    User4 should see 1 Country and 3 Customer
    ALL - means NO restriction
    Numeric values indicate the Dimension IDs
    Do let me know if further explanations required.
    Thanks,
    Sundar

    Hi Sundar,
    According to your description, you want to implement dynamic security using Security table in SQL Server Analysis Services Tabular model, right?
    It is very common to have data security implementation in BI projects either at databases or Cubes and sometimes this security implementation and maintenance goes out of control due to the dynamic flow of business information. Here are some links which describe
    dynamic security implementation at SSAS tabular model using an external security table, please see:
    http://bipassion.wordpress.com/2012/10/01/ssas-tabular-dynamic-security/
    http://www.bidn.com/blogs/ChrisSchmidt/ssas/4332/dynamic-security-in-tabular
    Regards,
    Charlie Liao
    TechNet Community Support

  • Data loaded to Power Pivot via Power Query is not yet supported in SSAS Tabular Cube

    Hello, I'm trying to create a SSAS Tabular cube from a data loaded to Power Pivot via Power Query (SAP BOBJ connector) but looks like is not yet supported.
    Any one tried this before? any workaround that make sense?
    The final goal is pull data from SAP BW, BO Universe (using PowerQuery) and be able to create a SSAS Tabular cube.
    Thanks in advance
    Sebastian

    Sebastian, 
    Depending on the size of the data from Analysis Services, one work around could be to import the data into into Excel and then make an Excel table and then use the Excel table as a data source. 
    Reeves
    Denver, CO

  • Dates Appearing in Tabular Model but not appearing on Pivot table

    Hi all,
    I am using SSAS tabular Model 2012, in tabular model all dates are appearing correct in date column but not when i drag attribute to my pivot table it shows only one date. Does anyone has the solution of this issue.
    Regards,
    Piyush

    Hi Piyush0308,
    According to your description, you have date column displayed all dates correctly in Tabualr. When showing in a Excel Pivot table, it only get the first date. Right?
    In this scenario, firstly please check the source table data in database, then make sure the data type of this column is Date in Tabualr. In Excel, please make sure there's no aggregation setting on this field. As I tested in our local environment, it should
    display same thing in tabular.
    If the issue still persists, please share some information about your date table so that we have some deep analysis.
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Optimize Fact tables in SSAS Tabular Model

    Hi,
    I have five Fact tables in SSAS Tabular Model and each fact table share same dimensions. It creates some performance issue and also the data model looks very complex is there any simplest way to create simple data model using all fact tables. For Ex...
    Please suggest me for this ...
    Fact Tables:
    Fact_Expense
    Fact_Sale
    Fact_Revenue
    Fact_COA
    Fact_COG
    Dimensions:
    Dim_Region
    Dim_Entity
    Dim_Product
    Dim_DateTime
    Dim_Project
    Dim_Employee
    Dim_Customer 

    Hi hussain,
      Please consider merging the Fact tables based on granularity. Generally, if you have enough RAM there will be no performance issues. Make sure you have double the amount of RAM to cater your processing and operational needs.Try
    to optimize the model design by removing unused keys and some high cardinality columns.
    Please go through the document in the link:
    http://msdn.microsoft.com/en-us/library/dn393915.aspx
    Regards,
    Venkata Koppula

  • SSAS Tabular model conection stops refreshing data for sometime

    Hi,
    I am using SSAS Tabular model and create connection files to use data with excel using powerpivot or powerview.
    But recently for 1 or 2 months it stops working for few mins (generally 20-60) and starts working again.
    It's happens for all 4 SSAS service on same server.
    I am using AD roles with SSAS Tabular model to filter the data.
    Everything is normal no event for this stop, no network error, no over usage of data.
    ERROR is:
    Errors in OLEDB provider. Could not connect to the redirector. Ensure that the SQLBrowser service is running on the 'ABC_Production' secver.

    Hi pinaKPatel,
    According to your description, you get the above error recently when using your tabular model. Right?
    Based on the error message, firstly, please check if the OLEDB provider is installed properly. Then check the SQLBrowser service is running. If everything is working, it may caused by the port blockage. Please follow the steps below:
    Use a fixed port and unblock that port in Windows Firewall. Connect to the server in this format: <servername>:<portnumber>.
    Use dynamic port assignments and SQL Server Browser service. Unblock the port used by SQL Server Browser service in Windows Firewall. Connect to the server in this format: <servername>\<instancename>.
    Use a fixed port and SQL Server Browser service together. This approach lets you connect using this format: <servername>\<instancename>, identical to the dynamic port assignment approach, except that in this case the server listens on a fixed port. 
    If the issue still persists, pelase redeploy your SSAS database. 
    Reference:
    Errors in the OLE DB provider
    If you have any question, please feel free to ask.
    Simon Hou
    TechNet Community Support

  • 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.

  • Excel SSAS Tabular error: An error occurred during an attempt to establish a connection to the external data source

    Hello there,
    I have an Excel report I created which works perfectly fine on my dev environment, but fails on my test environment when I try to do a data refresh.
    The key difference between both dev and test environments is that in dev, everything is installed in one server:
    SharePoint 2013
    SQL 2012: Database Instance, SSAS Instance, SSRS for SharePoint, SSAS POWERPIVOT instance (Powerpivot for SharePoint).
    In my test and production environments, the architecture is different:
    SQL DB Servers in High Availability (irrelevant for this report since it is connecting to the tabular model, just FYI)
    SQL SSAS Tabular server (contains a tabular model that processes data from the SQL DBs).
    2x SharePoint Application Servers (we installed both SSRS and PowerPivot for SharePoint on these servers)
    2x SharePoint FrontEnd Servers (contain the SSRS and PowerPivot add-ins).
    Now in dev, test and production, I can run PowerPivot reports that have been created in SharePoint without any issues. Those reports can access the SSAS Tabular model without any issues, and perform data refresh and OLAP functions (slicing, dicing, etc).
    The problem is with Excel reports (i.e. .xlsx files) uploaded to SharePoint. While I can open them, I am having a hard time performing a data refresh. The error I get is:
    "An error occurred during an attempt to establish a connection to the external data source [...]"
    I ran SQL Profiler on my SSAS Server where the Tabular instance is and I noticed that every time I try to perform a data refresh, I get the following entries:
    Every time I try to perform a data refresh, two entries under the user name ANONYMOUS LOGON.
    Since things work without any issues on my single-server dev environment, I tried running SQL Server Profiler there as well to see what I get.
    As you can see from the above, in the dev environment the query runs without any issues and the user name logged is in fact my username from the dev environment domain. I also have a separated user for the test domain, and another for the production domain.
    Now upon some preliminary investigation I believe this has something to do with the data connection settings in Excel and the usage (or no usage) of secure store. This is what I can vouch for so far:
    Library containing reports is configured as trusted in SharePoint Central Admin.
    Library containing data connections is configured as trusted in SharePoint Central Admin.
    The Data Provider referenced in the Excel report (MSOLAP.5) is configured as trusted in SharePoint Central Admin.
    In the Excel report, the Excel Services authentication settings is set as "use authenticated user's account". This wortks fine in the DEV environment.
    Concerning SecureStore, PowerPivot Configurator has configured it the PowerPivotUnnattendedAccount application ID in all the environments. There is
    NO configuration of an Application ID for Excel Services in any of the environments (Dev, test or production). Altough I reckon this is where the solution lies, I am not 100% sure as to why it fails in test and prod. But as I read what I am
    writing, I reckon this is because of the authentication "hops" through servers. Am I right in my assumption?
    Could someone please advise what am I doing wrong in this case? If it is the fact that I am missing an Secure Store entry for Excel Services, I am wondering if someone could advise me on how to set ip up? My confusion is around the "Target Application
    Type" setting.
    Thank you for your time.
    Regards,
    P.

    Hi Rameshwar,
    PowerPivot workbooks contain embedded data connections. To support workbook interaction through slicers and filters, Excel Services must be configured to allow external data access through embedded connection information. External data access is required
    for retrieving PowerPivot data that is loaded on PowerPivot servers in the farm. Please refer to the steps below to solve this issue:
    In Central Administration, in Application Management, click Manage service applications.
    Click Excel Services Application.
    Click Trusted File Location.
    Click http:// or the location you want to configure.
    In External Data, in Allow External Data, click Trusted data connection libraries and embedded.
    Click OK.
    For more information, please see:
    Create a trusted location for PowerPivot sites in Central Administration:
    http://msdn.microsoft.com/en-us/library/ee637428.aspx
    Another reason is Excel Services returns this error when you query PowerPivot data in an Excel workbook that is published to SharePoint, and the SharePoint environment does not have a PowerPivot for SharePoint server, or the SQL Server Analysis
    Services (PowerPivot) service is stopped. Please check this document:
    http://technet.microsoft.com/en-us/library/ff487858(v=sql.110).aspx
    Finally, here is a good article regarding how to troubleshoot PowerPivot data refresh for your reference. Please see:
    Troubleshooting PowerPivot Data Refresh:
    http://social.technet.microsoft.com/wiki/contents/articles/3870.troubleshooting-powerpivot-data-refresh.aspx
    Hope this helps.
    Elvis Long
    TechNet Community Support

  • How can I filter a table from Data Control without enter query

    I have a table from a web service data control based on WSDL.
    I want to filter the table without input query at filter text box. Without filter text box, each would filter the table with a hardcoded query internally.
    For example, when user click A menu button then it filters the table where type = '1' and B menu button filters the table by type='2' and C menu button filters the table by type=' ' .
    How can I filter the table without enter query?
    Could anyone point me to a solution please.
    Thanks.
    jdev 11.1.5
    Edited by: 893364 on Oct 26, 2011 12:15 PM
    Edited by: 893364 on Oct 26, 2011 12:21 PM

    Hi,
    when you created the table, did you try selecting the "filter" option. Select the table and go to the Property Inspctor. In the tool bar of the Property Inspector there is an icon to change the configuration. Its adding filter filter fields for the user to search in.
    Option 2: The data of the Web Service actually is held in the iterators. If you wanted to filter the WebService query, I would not use the WS DC but a JAX-WS proxy in a POJO to fetch the WS Data. Then have the Data Control created from the POJO. You could have a method exposed on the POJO that allows you to filter the internally held data
    Frank

Maybe you are looking for