Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rax99
Helper V
Helper V

Output DAX Evaluate results to a SQL Server Database table

Happy new year everyone!

 

So I have a DAX query stripped from PBI report that I have re-built in SSAS. But since my application doesnt like DAX, I thought pushing the set of DAX results to a database server table would be the ideal solution for my application to read.

How do I output the contents of a DAX query to a SQL Server database table? And if possible truncate the contents of the table before each run?

 

I'm using SQL Server 2016 if that helps.

1 ACCEPTED SOLUTION

Ok so that does make sense.

 

Only issue is how do you format such a query in sql server? how can I refer to an SSAS server instance/model to point the query at?

 

create view  vw.DAX

as

Evaluate( xyz )

 

Thanks, your helps been very appreciated thus far @parry2k 

View solution in original post

7 REPLIES 7
parry2k
Super User
Super User

@rax99 not sure fully what you mean by pushing DAX result out. You can sure  DAX Studio tool and run DAX expression there and it will show you the output, although I'm not sure if there is option to export the result set or not.

 

But in general this approach doesn't seems right.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

thanks for the reply @parry2k 

 

So yes what I need is the results of that DAX query to be exported/pushed into a sql table. Is there not a way of pushing the results into a sql temp table or any table in a database?

 

Reson I need to do it this way is my software app can't connect to SSAS to retrieve the results but can connect to a SQL server table to read the data. The idea is to output the aggregated results of DAX into a SQL Server table

@rax99 hmm still this doesn't seems to be the solution, I'm sure SSAS has some data source that should be your source for your app, and you shuld be converting DAX into Views and use that in yrou APP, rather exporting DAX to SQL Server. This all doesn't make sense even though you want to do it, just a suggestion and my feedback.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Sorry how do you mean 'Views'? are we talking SQL Server table Views?

 

 

@rax99 yes, and reason I mentioned that because you can have business logic in those views (translate DAX in those views)



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Ok so that does make sense.

 

Only issue is how do you format such a query in sql server? how can I refer to an SSAS server instance/model to point the query at?

 

create view  vw.DAX

as

Evaluate( xyz )

 

Thanks, your helps been very appreciated thus far @parry2k 

Did you find a solution for this? I have a similar issue, so if you managed to solve it, could you maybe post the script for the view you used?

 

Best regards.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.