Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Team,
I have a CTE in my sql which is giving ranking in a table and below is the code
select *, rank() over(partition by Empstatus,Emprole,Empdept order by empid) as Empid_Rank from EmployeeTable
now my requirement is, i wanted to create same ranking column in power query editor not in DAX.
can someone lookinto it and help me.
TIA
Solved! Go to Solution.
Thats absolutely what I'm looking for! Thank you!
Did you ever work this out? I also need rank over partition and can't seem to find how.
If anyone can pick this up, an example table for me personally would be something like:
ID | Modified_Date | Rank |
1001 | 01-01-2024 | 2 |
1001 | 05-01-2024 | 1 |
1002 | 03-01-2024 | 1 |
1003 | 07-01-2024 | 1 |
Output provides the latest modified from the table partitioned by ID.
Thanks
Hi Shadow,
Rank Column transform doesn't support partitions directly, but as a workaround you can first group rows in your table by the field you want to use as a partition criteria, then rank each of the partitions, and finally expand your nested ranked tables back into a single flat table.
Here's a sample M script that does this over the data example you shared:
hi!
Could you please share a more thorough example on what you're trying to achieve? if you can share a sample dataset and a sample output that would help us understand more what you're trying to accomplish without being directly associated with a language different than the one used by Power Query (inside of Dataflows).
As a more generic answer, when it comes to doing ranks in Power Query you can use the Rank column feature as described in the article below:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.