562 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
How to get data from tabular models using DAX queries in various programs
Part six of a six-part series of blogs
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.
This page shows how to import data into a PowerPivot data model by running a DAX query.
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.
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!
|Parts of this blog|
25 Aytoun Street