The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
11 | |
10 | |
10 | |
9 |