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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jainesh12
Frequent Visitor

SQL Query to DAX

SELECT customer_id, SUM(amount) AS total_sales
FROM orders
GROUP BY customer_id;

How can I convert it to a DAX function?
Is there any AI tool that converts SQL queries to DAX functions? (Except ChatGPT)

2 ACCEPTED SOLUTIONS
tamerj1
Super User
Super User

Hi @jainesh12 
If you are creting a measure then simply

total_sales = SUM ( Orders[Amount] )

If you want to create a calculated table

OrdersByCustomer =
SUMMARIZE ( Orders, Orders[Customer_id], "total_sales", SUM ( Orders[Amount] ) )

View solution in original post

@jainesh12 
There is no convertor, but you may try asking ChatGPT.

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @jainesh12 
If you are creting a measure then simply

total_sales = SUM ( Orders[Amount] )

If you want to create a calculated table

OrdersByCustomer =
SUMMARIZE ( Orders, Orders[Customer_id], "total_sales", SUM ( Orders[Amount] ) )

@tamerj1 Thank you for the suggestion.
This was just an example, do you know is their any requirement to convert SQL queries to DAX functions?
If yes, please suggest a few scenarios.

@jainesh12 
There is no convertor, but you may try asking ChatGPT.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors