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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

SQL to DAX conversion

Hello All,

I want to create a new calcualted table from existing source table. Since my source is excel, I cannot use direct SQL query. I have the SQL query but struggling to make up a DAX version.

Below is the query:
select companies,cluster,
cast(cast(individualcount as decimal(10,2))/cast(totalcount as decimal(10,2))*100 as decimal(10,2)) as Percentage
from
(select a.companies,a.cluster,a.count,b.totalcount from
(select companies,cluster,count(cluster) as individualcount from table
group by companies,cluster)a
inner join
(select cluster,count(cluster) as totalcount from table
group by cluster)b
on a.cluster=b.cluster)tb

 

Looking forward to your suggestions.

Thanks in advance.

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

You could refer to this article to undesrtand how to convert SQL to Dax.

If you still need help, please share your data sample which could reproduce your scenario and your desired output so that we could help further on it.

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
v-piga-msft
Resident Rockstar
Resident Rockstar

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 share more details.

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.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

You could refer to this article to undesrtand how to convert SQL to Dax.

If you still need help, please share your data sample which could reproduce your scenario and your desired output so that we could help further on it.

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.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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