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.
I have a very large table (>2m rows). I would like to replicate this excel formulation:
Basically, for each row, count the rows with the same 'Type' and where ID is up to current ID + 4.
If you've got 2 million rows, then your best option is Power Query, not DAX. If you try to do it in DAX as a calculated column (and if you try to use CACLULATE on top of that), you'll feel the pain. It'll last forever. Therefore, please take my advice: do it in Power Query.
Since in DAX there is no intrinsic concept of order, this phrase "count the rows after" calls for a column that will order the entries. Otherwise, what you want can't be done.
Thanks for your reply. I think since the ID increases as we go through the rows, I can ignore and remove this phrase. Just count of rows with the same 'Type' and where ID is up to current ID + 4
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
20 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |