cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Converting an SQL query to DAX

Hi, I am trying to convert an SQL query to Dax - any ideas please?
select
l.council,
sg,
type,
population,
case
when datepart(month, transaction_date) < 7 then 'H1' else 'H2' end as half,
datepart(year,transaction_date) as year,
sum(amount) as total
from
sg_client_region l join sg_trans_mapped r
on l.clientID = r.customer_id
join pops r2 on l.council = r2.council
where r.subcategory not like ('%transfer%') and transaction_date > '2017-01-01'
group by
l.council, sg, type, population, datepart(year,transaction_date),
case when datepart(month, transaction_date) < 7 then 'H1' else 'H2' end;

Cheers

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resident Rockstar
Resident Rockstar

Re: Converting an SQL query to DAX

Hi @Anonymous ,

For your requirement, you could refer to this article about how to convert SQL query to DAX firstly.

If you still need help, please share your data sample and your desired output so that I could write the dax expression.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

Highlighted
Resident Rockstar
Resident Rockstar

Re: Converting an SQL query to DAX

Hi @Anonymous ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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
Highlighted
Resident Rockstar
Resident Rockstar

Re: Converting an SQL query to DAX

Hi @Anonymous ,

For your requirement, you could refer to this article about how to convert SQL query to DAX firstly.

If you still need help, please share your data sample and your desired output so that I could write the dax expression.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

Highlighted
Resident Rockstar
Resident Rockstar

Re: Converting an SQL query to DAX

Hi @Anonymous ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please feel free to ask.

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors