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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Convert sql to M

Hello All,

 

How do I write below sql into M query:

 

select sum(Sales) over (aprtiton by Country, State) from emp;

 

select count  (empid) over() from emp2;

 

Thanks,

Aditya

4 REPLIES 4
JosefPrakljacic
Solution Sage
Solution Sage

Hey @Anonymous ,

 

I would rather do this. And it would be better to do it like this according to this link.

 

image_thumb6.png

 

If this post was helpful may I ask you to mark it as solution and give it some kudos?

Have a nice day!

BR,
Josef

Anonymous
Not applicable

NO, I would like to know how this works

I need to apologize @Anonymous 

 

I thought you wanted to have the optimal solution to your problem.

 

But if you want to know how to do this technically, then I can refer you to this link.

 

The principle is the same as yours.

 

If this post was helpful may I ask you to mark it as solution and give it some kudos?

Have a nice day!

BR,
Josef

Anonymous
Not applicable

In the example shown it is a Row number, I need a sum

(Sum of the entire column, Example:  sum(sales) Over( order  by  year) 

 

, I have tried it but unable t get it. Can you please show through an example 

 

@Greg_Deckler 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors