Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
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
Hey @Anonymous ,
I would rather do this. And it would be better to do it like this according to this link.
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
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
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
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 128 | |
| 104 | |
| 56 | |
| 39 | |
| 31 |