I've done this many times by creating a linked server in SQL server that connects to the SSAS instance.
Stacia has a good brief article about this
There are, however, some caveats and it tends to get very complicated very quickly.
If the SSAS instance and the SQL Server instance are on the same server then that makes things easier, but if they aren't you might come up against the double hop issue which requires you to get your hands dirty with kerberos.
You can't use dynamic SQL within an OPENQUERY call, but a workaround is that you can set the entire query as a variable which can then be dynamic, with the varchar limit of 8000. This is useful if you intend to make this a stored procedure.
The datatype difference between SSAS and SQL server can also trip you up. All the fields seem to be returned as ntext which can't be converted to many other types, so you might need to cast as varchar before casting as any other data type before inserting to your table.