### Install Analysis Services in Tabular Mode via Command Line Source: https://learn.microsoft.com/en-us/analysis-services/instances/install-windows/install-analysis-services Use this command-line setup to install Analysis Services in Tabular server mode. Ensure all placeholder account values are replaced with valid credentials and that the INSTANCENAME is less than 17 characters. ```PowerShell Setup.exe /q /IAcceptSQLServerLicenseTerms /ACTION=install /FEATURES=AS /ASSERVERMODE=TABULAR /INSTANCENAME=ASTabular /INDICATEPROGRESS /ASSVCACCOUNT= /ASSVCPASSWORD= /ASSYSADMINACCOUNTS= ``` -------------------------------- ### Command Line Installation with Logging Source: https://learn.microsoft.com/en-us/analysis-services/instances/install-windows/install-or-uninstall-the-power-pivot-for-sharepoint-add-in-sharepoint-2013 Install Power Pivot for SharePoint and create an installation log file using verbose logging. Specify the path for the log file. ```cmd Msiexec.exe /i SpPowerPivot.msi /L v c:\test\Install_Log.txt ``` -------------------------------- ### Install Power Pivot with Logging Source: https://learn.microsoft.com/en-us/analysis-services/instances/install-windows/install-or-uninstall-the-power-pivot-for-sharepoint-add-in-sharepoint-2016 Use this command to install Power Pivot for SharePoint and create a verbose installation log file. ```cmd Msiexec.exe /i spPowerPivot16.msi /L v c:\test\Install_Log.txt ``` -------------------------------- ### Example Server Name for Analysis Services Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-async-refresh An example of how to format the server name for Analysis Services, including the region. ```text asazure://westus.asazure.windows.net/myserver ``` -------------------------------- ### Tabular DisplayKey Example (CSDLBI 1.1) Source: https://learn.microsoft.com/en-us/analysis-services/csdlbi/displaykey-element-csdlbi This is a placeholder for a tabular data model example. The actual code is in progress. ```XML ``` -------------------------------- ### Restore Database Example Source: https://learn.microsoft.com/en-us/analysis-services/tmsl/restore-command-tmsl Example of restoring a database from a local folder. This snippet shows how to specify the database name, file path, overwrite settings, and password. ```json { "restore": { "database":"AdventureWorksDW2014", "file":"c:\\awdbdwfile.abf", "security":"...", "allowOverwrite":"true", "password":"..", "locations":"d:\\SQL Server Analysis Services\\data\\", "storageLocation":".." } } ``` -------------------------------- ### Basic Command Line Installation Source: https://learn.microsoft.com/en-us/analysis-services/instances/install-windows/install-or-uninstall-the-power-pivot-for-sharepoint-add-in-sharepoint-2013 Use this command to install Power Pivot for SharePoint via the command line. Administrator privileges are required. ```cmd Msiexec.exe /i SpPowerPivot.msi ``` -------------------------------- ### Example Base URL for Analysis Services Model Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-async-refresh An example of a complete base URL for a specific Analysis Services model on a given server. ```text https://westus.asazure.windows.net/servers/myserver/models/AdventureWorks/ ``` -------------------------------- ### Example WHERE Clause Filters for Partitions Source: https://learn.microsoft.com/en-us/analysis-services/multidimensional-models/create-and-manage-a-local-partition-analysis-services These examples demonstrate how to filter data for Analysis Services partitions using WHERE clauses. Ensure filters are mutually exclusive to avoid data duplication. ```SQL WHERE OrderDateKey >= '20060101' ``` ```SQL WHERE OrderDateKey BETWEEN '20051001' AND '20051201' ``` -------------------------------- ### Example: Query Parameters for 'TM Clustering' Model Source: https://learn.microsoft.com/en-us/analysis-services/data-mining/query-the-parameters-used-to-create-a-mining-model This example demonstrates how to query the specific parameters used for the 'TM Clustering' model, including explicit values for defaults. ```DMX SELECT MINING_PARAMETERS FROM $system.DMSCHEMA_MINING_MODELS WHERE MODEL_NAME = 'TM Clustering' ``` -------------------------------- ### Example Reporting Action URL Source: https://learn.microsoft.com/en-us/analysis-services/multidimensional-models/actions-in-multidimensional-models An example of a complete URL for a reporting action, demonstrating how to specify the report server, command, and parameters like 'Region'. ```text http://localhost/ReportServer/Sales/YearlySalesByCategory?rs:Command=Render&Region=West ``` -------------------------------- ### Verify ADOMD.Net Client Library Source: https://learn.microsoft.com/en-us/analysis-services/instances/install-windows/checklist-use-powershell-to-verify-power-pivot-for-sharepoint This script helps verify the installation of the ADOMD.NET client library by querying WMI for installed products matching 'ado'. ```PowerShell get-wmiobject -class win32_product | Where-Object {$_.name -like "*ado*"} | select name, version, vendor | format-table -property * -autosize | out-default ``` -------------------------------- ### Service Principal Profile Authentication Example Source: https://learn.microsoft.com/en-us/analysis-services/client-libraries Connection string example for authenticating with Service Principal Profiles starting with AMO and ADOMD version 19.82.0.0. Users cannot connect to workspaces with a Premium Per-User license using this method through the XMLA endpoint. ```plaintext Data Source=powerbi://api.powerbi.com/v1.0/myorg/;User ID=app:@;SPN Profile=;Password= ``` -------------------------------- ### Example Backup Command Source: https://learn.microsoft.com/en-us/analysis-services/tmsl/backup-command-tmsl Demonstrates how to back up a database file to the default backup folder using the TMSL Backup command. ```json { "backup": { "database":"AS_AdventureWorksDW2014", "file":"AS_AdventureWorksDW2014.abf", "password":"secret" } } ``` -------------------------------- ### Create Database Example (XMLA) Source: https://learn.microsoft.com/en-us/analysis-services/xmla/xml-elements-commands/create-element-xmla This example demonstrates how to create an empty database named 'Test Database' on an Analysis Services instance using the XMLA Create command. It specifies the database name and a description. ```xml Test Database A test database. ``` -------------------------------- ### Get Refresh Status Response Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-async-refresh Example response body when checking the status of a specific refresh operation. Indicates 'inProgress' if the operation is ongoing. ```json { "startTime": "2017-12-07T02:06:57.1838734Z", "endTime": "2017-12-07T02:07:00.4929675Z", "type": "full", "status": "succeeded", "currentRefreshType": "full", "objects": [ { "table": "DimCustomer", "partition": "DimCustomer", "status": "succeeded" }, { "table": "DimDate", "partition": "DimDate", "status": "succeeded" } ] } ``` -------------------------------- ### GET /refreshes Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-async-refresh Retrieves a list of historical refresh operations for a model. This endpoint provides a history of past refreshes, including their IDs, start and end times, and status. ```APIDOC ## GET /refreshes ### Description To get a list of historical refresh operations for a model, use the GET verb on the /refreshes collection. At time of writing, the last 30 days of refresh operations are stored and returned, but this number could change. ### Method GET ### Endpoint /refreshes ### Response #### Success Response (200) - **refreshId** (string) - The unique identifier of the refresh operation. - **startTime** (string) - The start time of the refresh operation. - **endTime** (string) - The end time of the refresh operation. - **status** (string) - The status of the refresh operation (e.g., 'succeeded'). ### Response Example ```json [ { "refreshId": "1344a272-7893-4afa-a4b3-3fb87222fdac", "startTime": "2017-12-07T02:06:57.1838734Z", "endTime": "2017-12-07T02:07:00.4929675Z", "status": "succeeded" }, { "refreshId": "474fc5a0-3d69-4c5d-adb4-8a846fa5580b", "startTime": "2017-12-07T01:05:54.157324Z", "endTime": "2017-12-07T01:05:57.353371Z", "status": "succeeded" } ] ``` ``` -------------------------------- ### Get List of Historical Refreshes Response Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-async-refresh Example response body for retrieving a list of historical refresh operations for a model. Note that the last 30 days of operations are typically returned. ```json [ { "refreshId": "1344a272-7893-4afa-a4b3-3fb87222fdac", "startTime": "2017-12-07T02:06:57.1838734Z", "endTime": "2017-12-07T02:07:00.4929675Z", "status": "succeeded" }, { "refreshId": "474fc5a0-3d69-4c5d-adb4-8a846fa5580b", "startTime": "2017-12-07T01:05:54.157324Z", "endTime": "2017-12-07T01:05:57.353371Z", "status": "succeeded" } ] ``` -------------------------------- ### AccessToken Property for OAuth Tokens Source: https://learn.microsoft.com/en-us/analysis-services/client-libraries Example demonstrating the use of the AccessToken property in connectivity objects like AdomdConnection and Server, starting with version 19.67.0. This property allows passing external OAuth tokens for XMLA connectivity. ```plaintext User ID=...; Password=... ``` -------------------------------- ### Create and Manage a Session in ADOMD.NET (C#) Source: https://learn.microsoft.com/en-us/analysis-services/adomd/multidimensional-models-adomd-net-client/connections-in-adomd-net-working-with-connections-and-sessions This C# example shows how to establish a connection, obtain a session ID, and then close the connection while preserving the session. Ensure you have the ADOMD.NET library and a correct connection string. ```C# static string CreateSession(string connectionString) { string strSessionID = ""; AdomdConnection objConnection = new AdomdConnection(); try { /*First, try to connect to the specified data source. If the connection string is not valid, or if the specified provider does not support sessions, an exception is thrown. */ objConnection.ConnectionString = connectionString; objConnection.Open(); // Now that the connection is open, retrieve the new // active session ID. strSessionID = objConnection.SessionID; // Close the connection, but leave the session open. objConnection.Close(false); return strSessionID; } finally { objConnection = null; } } ``` -------------------------------- ### Create and Configure Internet Sales Partitions Source: https://learn.microsoft.com/en-us/analysis-services/amo/programming-amo-olap-basic-objects This C# code creates three partitions for the 'InternetSales' measure group, each with a different data slice and annotation. It includes logic to drop existing partitions with the same name before creating new ones. Partitions are configured with MOLAP storage mode and specific SQL query bindings. ```C# static void CreateInternetSalesMeasureGroupPartitions(MeasureGroup mg) { Partition part; part = mg.Partitions.FindByName("Internet_Sales_184"); if ( part != null) part.Drop(); part = mg.Partitions.Add("Internet_Sales_184"); part.StorageMode = StorageMode.Molap; part.Source = new QueryBinding(db.DataSources[0].ID, "SELECT * FROM [dbo].[FactInternetSales] WHERE OrderDateKey <= '184'"); part.Slice = "[Date].[Calendar Year].&[2001]"; part.Annotations.Add("LastOrderDateKey", "184"); part = mg.Partitions.FindByName("Internet_Sales_549"); if ( part != null) part.Drop(); part = mg.Partitions.Add("Internet_Sales_549"); part.StorageMode = StorageMode.Molap; part.Source = new QueryBinding(db.DataSources[0].ID, "SELECT * FROM [dbo].[FactInternetSales] WHERE OrderDateKey > '184' AND OrderDateKey <= '549'"); part.Slice = "[Date].[Calendar Year].&[2002]"; part.Annotations.Add("LastOrderDateKey", "549"); part = mg.Partitions.FindByName("Internet_Sales_914"); if ( part != null) part.Drop(); part = mg.Partitions.Add("Internet_Sales_914"); part.StorageMode = StorageMode.Molap; part.Source = new QueryBinding(db.DataSources[0].ID, "SELECT * FROM [dbo].[FactInternetSales] WHERE OrderDateKey > '549' AND OrderDateKey <= '914'"); part.Slice = "[Date].[Calendar Year].&[2003]"; part.Annotations.Add("LastOrderDateKey", "914"); } ``` -------------------------------- ### Example MultipleOrEmptySelectionExpression Source: https://learn.microsoft.com/en-us/analysis-services/tabular-models/calculation-groups DAX example of a configured multipleOrEmptySelectionExpression for a calculation group. ```dax IF ( ISFILTERED ( 'MyCalcGroup' ), "Filters: " & CONCATENATEX ( FILTERS ( 'MyCalcGroup'[Name] ), 'MyCalcGroup'[Name], ", " ) ) ``` -------------------------------- ### Setup Session Trace for Current Activities Source: https://learn.microsoft.com/en-us/analysis-services/amo/programming-amo-complementary-classes-and-methods Sets up a session trace to monitor current Analysis Services activities. Event handlers output trace information to the console. The 'Adventure Works' sample cube is processed to generate tracing events. ```csharp static public void TestSessionTraces(Server svr) { // Start the default trace svr.SessionTrace.OnEvent += new TraceEventHandler(DefaultTrace_OnEvent); svr.SessionTrace.Stopped += new TraceStoppedEventHandler(DefaultTrace_Stopped); svr.SessionTrace.Start(); // Process the databases // The trace handlers will output all progress notifications // to the console Database db = svr.Databases.FindByName("Adventure Works DW Multidimensional 2012"); Cube cube = db.Cubes.FindByName("Adventure Works"); cube.Process(ProcessType.ProcessFull); // Stop the default trace svr.SessionTrace.Stop(); } static public void DefaultTrace_OnEvent(object sender, TraceEventArgs e) { Console.WriteLine("{0}", e.TextData); } static public void DefaultTrace_Stopped(ITrace sender, TraceStoppedEventArgs e) { switch (e.StopCause) { case TraceStopCause.StoppedByUser: case TraceStopCause.Finished: Console.WriteLine("Processing completed successfully"); break; case TraceStopCause.StoppedByException: Console.WriteLine("Processing failed: {0}", e.Exception.Message); break; } } ``` -------------------------------- ### Measure Example Source: https://learn.microsoft.com/en-us/analysis-services/tabular-models/measures-ssas-tabular Example of a DAX formula for a measure that calculates the sum of total profit. ```DAX Sum of TotalProfit: =SUM([TotalProfit]) ``` -------------------------------- ### Install Az.AnalysisServices Module Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-powershell Installs the Az.AnalysisServices PowerShell module for managing Azure Analysis Services resources. ```powershell Install-Module -Name Az.AnalysisServices ``` -------------------------------- ### Calculated Column Example Source: https://learn.microsoft.com/en-us/analysis-services/tabular-models/measures-ssas-tabular Example of a calculated column formula in DAX to calculate total profit for each row. ```DAX =[SalesAmount] - [TotalCost] - [ReturnAmount] ``` -------------------------------- ### Analysis Services Deployment Utility Syntax Source: https://learn.microsoft.com/en-us/analysis-services/deployment/deploy-model-solutions-with-the-deployment-utility The basic syntax for running the Analysis Services Deployment Utility from the command line. Use this to understand the structure of commands and available options. ```bash Microsoft.AnalysisServices.Deployment [ASdatabasefile] {[/s[:logfile]] | [/a] | [[/o[:output_script_file]] [/d]]} ``` -------------------------------- ### Create a Table with Columns and a Partition Source: https://learn.microsoft.com/en-us/analysis-services/tom/create-tables-partitions-and-columns-in-a-tabular-model This C# code defines a new table named 'Customers' with several data columns, including 'FirstName', 'MiddleName', 'LastName', 'PhoneNumber', 'EmailAddress', and 'City'. It also configures a partition for this table. The database and table are then added to the server, and a full refresh is requested. ```csharp using Microsoft.AnalysisServices.Tabular; using System; using System.Collections.Generic; namespace CreateTableExample { class Program { static void Main(string[] args) { // Create a new tabular model server object Server server = new Server(); server.Connect("localhost:8080"); // Replace with your server details // Create a new database object Database dbWithTable = new Database("MyDatabase"); dbWithTable.Model = new Model("MyModel"); dbWithTable.Model.Database = dbWithTable; // Create a new table object Table table = new Table(dbWithTable.Model, "Customers"); table.Description = "Customer data from AdventureWorks"; dbWithTable.Model.Tables.Add(table); // Add a partition to the table Partition partition = new Partition(table); partition.Name = "CustomersPartition"; table.Partitions.Add(partition); // Define the query for the partition partition.Query = "SELECT FirstName, MiddleName, LastName, PhoneNumber, EmailAddress, City FROM [Sales].[vIndividualCustomer]"; // Define columns for the table table.Columns.Add(new DataColumn() { Name = "FirstName", DataType = DataType.String, SourceColumn = "FirstName" }); table.Columns.Add(new DataColumn() { Name = "MiddleName", DataType = DataType.String, SourceColumn = "MiddleName" }); table.Columns.Add(new DataColumn() { Name = "LastName", DataType = DataType.String, SourceColumn = "LastName" }); table.Columns.Add(new DataColumn() { Name = "PhoneNumber", DataType = DataType.String, SourceColumn = "PhoneNumber" }); table.Columns.Add(new DataColumn() { Name = "EmailAddress", DataType = DataType.String, SourceColumn = "EmailAddress" }); table.Columns.Add(new DataColumn() { Name = "City", DataType = DataType.String, SourceColumn = "City" }); // Add the new database object to the server's Databases connection and submit the changes server.Databases.Add(dbWithTable); dbWithTable.Model.RequestRefresh(Microsoft.AnalysisServices.Tabular.RefreshType.Full); dbWithTable.Update(UpdateOptions.ExpandFull); Console.Write("Database "); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(dbWithTable.Name); Console.ResetColor(); Console.WriteLine(" created successfully."); Console.WriteLine("The data model includes the following table definitions:"); Console.ForegroundColor = ConsoleColor.Yellow; foreach (Table tbl in dbWithTable.Model.Tables) { Console.WriteLine("\tTable name:\t\t{0}", tbl.Name); Console.WriteLine("\ttbl description:\t{0}", tbl.Description); } Console.ResetColor(); Console.WriteLine(); Console.WriteLine("Press Enter to close this console window."); Console.ReadLine(); } } } ``` -------------------------------- ### Example AR Polynomial Term with Root Near 1 Source: https://learn.microsoft.com/en-us/analysis-services/data-mining/microsoft-time-series-algorithm-technical-reference Demonstrates an example of an AR polynomial term that has a root close to 1, which the algorithm may eliminate to preserve model stability. This example shows the elimination of a term that cannot increase the difference order further. ```mathematics 1 - 1.4B + .45B^2 = (1- .9B) (1- 0.5B) ``` -------------------------------- ### Full Processing of a Database Source: https://learn.microsoft.com/en-us/analysis-services/multidimensional-models-scripting-language-assl-xmla/processing-objects-xmla This example demonstrates how to fully process an entire Analysis Services database. Use this when you need to reprocess all objects within a database. ```XML Adventure Works DW Multidimensional 2012 ProcessFull UseExisting ``` -------------------------------- ### Install SqlServer Module Source: https://learn.microsoft.com/en-us/analysis-services/azure-analysis-services/analysis-services-powershell Installs the SqlServer PowerShell module, which includes cmdlets for managing Azure Analysis Services databases. ```powershell Install-Module -Name SqlServer ``` -------------------------------- ### Install Specific Components via Command Line Source: https://learn.microsoft.com/en-us/analysis-services/instances/install-windows/install-or-uninstall-the-power-pivot-for-sharepoint-add-in-sharepoint-2016 Install Power Pivot for SharePoint, including specific components like data providers, while excluding the configuration tool. Ensure you agree to the license terms. ```cmd Msiexec /i spPowerPivot16.msi AGREETOLICENSE="yes" ADDLOCAL=" SQL_OLAPDM,SQL_ADOMD,SQL_AMO,SQLAS_SP_Common" ``` -------------------------------- ### Incremental Processing of a Partition with Bindings Source: https://learn.microsoft.com/en-us/analysis-services/multidimensional-models-scripting-language-assl-xmla/processing-objects-xmla This example shows how to incrementally process a specific partition within a measure group. It uses an out-of-line query binding to specify the source data for adding new aggregations. ```XML Adventure Works DW Multidimensional 2012 Adventure Works DW Fact Internet Sales 1 Internet_Sales_2006 Adventure Works DW Multidimensional 2012 Adventure Works DW Fact Internet Sales 1 Internet_Sales_2006 Adventure Works DW SELECT [dbo].[FactInternetSales].[ProductKey], [dbo].[FactInternetSales].[OrderDateKey], [dbo].[FactInternetSales].[DueDateKey], [dbo].[FactInternetSales].[ShipDateKey], [dbo].[FactInternetSales].[CustomerKey], [dbo].[FactInternetSales].[PromotionKey], [dbo].[FactInternetSales].[CurrencyKey], [dbo].[FactInternetSales].[SalesTerritoryKey], [dbo].[FactInternetSales].[SalesOrderNumber], [dbo].[FactInternetSales].[SalesOrderLineNumber], [dbo].[FactInternetSales].[RevisionNumber], [dbo].[FactInternetSales].[OrderQuantity], [dbo].[FactInternetSales].[UnitPrice], [dbo].[FactInternetSales].[ExtendedAmount], [dbo].[FactInternetSales].[UnitPriceDiscountPct], [dbo].[FactInternetSales].[DiscountAmount], [dbo].[FactInternetSales].[ProductStandardCost], [dbo].[FactInternetSales].[TotalProductCost], [dbo].[FactInternetSales].[SalesAmount], [dbo].[FactInternetSales].[TaxAmt], [dbo].[FactInternetSales].[Freight], [dbo].[FactInternetSales].[CarrierTrackingNumber], [dbo].[FactInternetSales].[CustomerPONumber] FROM [dbo].[FactInternetSales] WHERE OrderDateKey > '1280' ProcessAdd UseExisting ``` -------------------------------- ### Tabular Model PropertyRef Example Source: https://learn.microsoft.com/en-us/analysis-services/csdlbi/propertyref-element-csdlbi This CSDLBI 1.1 example shows a PropertyRef element specifying the source of a formula for a measure in a Tabular model. ```XML ``` -------------------------------- ### Create a Table, Column, and Partition in a Tabular Model Source: https://learn.microsoft.com/en-us/analysis-services/tom/create-tables-partitions-and-columns-in-a-tabular-model This C# code demonstrates how to connect to an Analysis Services instance, create a new database, define a Tabular model, add a data source, and then create a table with a partition. The partition is configured to import data from a SQL Server view using a QueryPartitionSource. This is a typical scenario for loading data into a Tabular solution. ```C# using System; using Microsoft.AnalysisServices; using Microsoft.AnalysisServices.Tabular; namespace TOMSamples { class Program { static void Main(string[] args) { // // Connect to the local default instance of Analysis Services // string ConnectionString = "DataSource=localhost"; // // The using syntax ensures the correct use of the // Microsoft.AnalysisServices.Tabular.Server object. // using (Server server = new Server()) { server.Connect(ConnectionString); // // Generate a new database name and use GetNewName // to ensure the database name is unique. // string newDatabaseName = server.Databases.GetNewName("Database with a Table Definition"); // // Instantiate a new // Microsoft.AnalysisServices.Tabular.Database object. // var dbWithTable = new Database() { Name = newDatabaseName, ID = newDatabaseName, CompatibilityLevel = 1200, StorageEngineUsed = StorageEngineUsed.TabularMetadata, }; // // Add a Microsoft.AnalysisServices.Tabular.Model object to the // database, which acts as a root for all other Tabular metadata objects. // dbWithTable.Model = new Model() { Name = "Tabular Data Model", Description = "A Tabular data model at the 1200 compatibility level." }; // // Add a Microsoft.AnalysisServices.Tabular.ProviderDataSource object // to the data Model object created in the previous step. The connection // string of the data source object in this example // points to an instance of the AdventureWorks2014 SQL Server database. // string dataSourceName = "SQL Server Data Source Example"; dbWithTable.Model.DataSources.Add(new ProviderDataSource() { Name = dataSourceName, Description = "A data source definition that uses explicit Windows credentials for authentication against SQL Server.", ConnectionString = "Provider=SQLNCLI11;Data Source=localhost;Initial Catalog=AdventureWorks2014;Integrated Security=SSPI;Persist Security Info=false", ImpersonationMode = Microsoft.AnalysisServices.Tabular.ImpersonationMode.ImpersonateAccount, Account = @".\Administrator", Password = "P@ssw0rd", }); // // Add a table called Individual Customers to the data model // with a partition that points to a [Sales].[vIndividualCustomer] view // in the underlying data source. // dbWithTable.Model.Tables.Add(new Table() { Name = dbWithTable.Model.Tables.GetNewName("Individual Customers"), Description = "Individual customers (names and email addresses) that purchase Adventure Works Cycles products online.", Partitions = { // // Create a single partition with a QueryPartitionSource for a query // that imports all customer rows from the underlying data source. // new Partition() { Name = "All Customers", Source = new QueryPartitionSource() { DataSource = dbWithTable.Model.DataSources[dataSourceName], Query = @"SELECT [FirstName] ,[MiddleName] ,[LastName] ,[PhoneNumber] ,[EmailAddress] ``` -------------------------------- ### DRILLTHROUGH Statement Example Source: https://learn.microsoft.com/en-us/analysis-services/multidimensional-models/mdx/mdx-data-manipulation-retrieve-source-data-using-drillthrough This example demonstrates how to use the DRILLTHROUGH statement to query dimension leaves and return specific measures and attributes from the source data. ```mdx DRILLTHROUGH Select {Leaves(Store), Leaves(Product), Leaves(Time),*} on 0 From Stores RETURN [Department MeasureGroup].[Department Id], [Employee].[First Name] ```