BLOGS BY TOPIC▼
BLOGS BY AUTHOR▼
BLOGS BY YEAR▼
Knowing how to write DAX queries is one thing, but where are you going to use them? This blog shows how you can integrate DAX queries into SSMS, SSRS, SSIS, Excel and PowerPivot.
- Using DAX queries in SQL Server and other applications
- Running DAX queries within Management Studio
- Basing SSRS (Reporting Services) reports on DAX queries
- Writing DAX queries in Integration Services (SSIS)
- Retrieving data into Excel using DAX queries
- Loading data into PowerPivot data models using DAX queries (this blog)
This blog is part of our online SSAS Tabular tutorial; we also offer lots of other Analysis Services training resources.
Posted by Andy Brown on 18 February 2016
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Loading data into PowerPivot data models using DAX queries
This page shows how to import data into a PowerPivot data model by running a DAX query.
Once more, I'm assuming that readers already know PowerPivot. If you don't, a quick guide to using PowerPivot for tabular model users is covered in this blog. Alternatively, you could watch my YouTube tutorials, or attend a Wise Owl PowerPivot course.
Starting to load data
From Excel, go into PowerPivot and choose to import data as follows:

Choose to import data from Analysis Services.
Choose a server (I've gone for .\sql2012, but yours will be different):

Type in the name of your server.
Further down in the same dialog box, you can now choose the model from which you want to extract data:

We'll take data from our tutorial model.
Pasting or typing in the DAX query
On the next step of the Table Import Wizard, you can type or paste in your DAX query:

Here I've not only typed (OK, pasted) in a DAX query, but I've clicked on the Validate button (not shown in the diagram) to check it's OK. Reassuringly, PowerPivot tells me that my MDX statement is valid, even though it isn't actually an MDX statement!
PowerPivot now loads the data just like for any other table:

The results of running the DAX query shown above.
You can obviously use the same trick to import data into PowerPivot from an Analysis Services multi-dimensional model cube, using MDX.
And with that, I have run out of applications in which to use DAX queries!
- Using DAX queries in SQL Server and other applications
- Running DAX queries within Management Studio
- Basing SSRS (Reporting Services) reports on DAX queries
- Writing DAX queries in Integration Services (SSIS)
- Retrieving data into Excel using DAX queries
- Loading data into PowerPivot data models using DAX queries (this blog)