564 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 four 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 using SQL Server Integration Services (SSIS) and DAX queries.
The first thing to do is to add a data source into a data flow task:
Add an OLEDB data source into a new data flow task within a new package.
Choose to create a new connection for this data source:
Click on this button when editing the source to add a connection.
Now choose to create a new connection:
Click on this button at the bottom right of the dialog box which appears, to add a new connection.
You can now choose the appropriate provider:
I've got SQL Server 2014 on my laptop, but I've chosen the provider for Analysis Services 11.0, which is the internal name for SQL Server 2012.
Now type in the server you want to connect to:
Type in the Analysis Services server name (yours will be different). The Location seems irrelevant for our purposes!
You should now be able to choose the model to which you want to connect:
Choose a tabular model from the drop list, ignoring the odd Initial catalog label to the left of it.
You should now have a dialog box looking something like this:
You've created a connection; time now to choose how you want to use it.
Choose the data access mode as an SQL command (even though it isn't), and type or paste in your DAX query:
Choose SQL command, and type or paste in the query.
I've gone for the following query again:
Even though it's not SQL, the Parse Query button still works:
You can parse this query to check you've got the syntax right.
The Preview button confirms whether you've got the right data:
... to run the DAX query.
Time now to move from using DAX in SQL Server to retrieving data into Excel.
|Parts of this blog|
25 Aytoun Street