cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
analystict Regular Visitor
Regular Visitor

The SQL Code Behind A Dax Measure

Hi,

 

Is there some kind of way to convert a DAX measure to an SQL statement?

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: The SQL Code Behind A Dax Measure

Hi @analystict ,

 

There isn’t an option to convert a DAX measure to an SQL statement directly in Power BI.   You can reference  the following link to convert manually.

https://www.sqlbi.com/articles/from-sql-to-dax-filtering-data/

 

 

If you want to check the SQL statement behind a DAX Measure. You can reference this link to use SQL profiler to check the SQL code . But the functions that can be used in DAX are not necessarily available in SQL statement, and the reverse is also true.

 

For any question about T-SQL, I would suggest you post thread on Transact_SQL forum.  When you create a  thread, please post sample data to show others the original dataset and your expected result.

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=transactsql%2Csqlreplication%2Cs...

 

Best Regards,

Xue Ding

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
adetogni Senior Member
Senior Member

Re: The SQL Code Behind A Dax Measure

Yes using dax studio
Community Support Team
Community Support Team

Re: The SQL Code Behind A Dax Measure

Hi @analystict ,

 

There isn’t an option to convert a DAX measure to an SQL statement directly in Power BI.   You can reference  the following link to convert manually.

https://www.sqlbi.com/articles/from-sql-to-dax-filtering-data/

 

 

If you want to check the SQL statement behind a DAX Measure. You can reference this link to use SQL profiler to check the SQL code . But the functions that can be used in DAX are not necessarily available in SQL statement, and the reverse is also true.

 

For any question about T-SQL, I would suggest you post thread on Transact_SQL forum.  When you create a  thread, please post sample data to show others the original dataset and your expected result.

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=transactsql%2Csqlreplication%2Cs...

 

Best Regards,

Xue Ding

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 226 members 2,477 guests
Please welcome our newest community members: