Index by category in Power BI equivalent to SQL row_number over partition
问题 How to add index by category in M of Power BI with sorting by column. I look for equivalent of SQL: ROW_NUMBER() over(partition by [Category] order by [Date] desc Suppose we have a table: +----------+-------+------------+ | Category | Value | Date | +----------+-------+------------+ | apples | 3 | 2018-07-01 | | apples | 2 | 2018-07-02 | | apples | 1 | 2018-07-03 | | bananas | 9 | 2018-07-01 | | bananas | 8 | 2018-07-02 | | bananas | 7 | 2018-07-03 | +----------+-------+------------+ Desired