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

Get Fabric certified for FREE! Don't miss your chance! Learn more

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.