Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Here is the sample data.Dataset is group by ID,Sorted by ID,week start date. Is it possible to repeat the index number after every 4 rows.
I am expecting to see 1,2,3,4,1,2,3,4,1,2,3,4 etc as my index number
Solved! Go to Solution.
Hi Lavanya.
I'm not sure exactly how to solve this the most efficient way, but I believe you may be able to get close using some of the following:
Create a Custom Column 'DivideByFour', Where you divide your current Index column by 4.
Create a new Custom Column, 'ResetRows': If [DivideByFour] / [DivideByFour] = 1 then [DivideByFour] else null.
Use a fill action on your ResetRows column to fill out the empty rows, effectively grouping your rows into groups of four rows.
Finally, follow othis guide (or find another similar via Google) to create an Index which resets every time your ResetRows group value changes: PowerQuery - Index Column That Restarts Based on a Grouped Column (devcodef1.com)
_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Hi Lavanya.
I'm not sure exactly how to solve this the most efficient way, but I believe you may be able to get close using some of the following:
Create a Custom Column 'DivideByFour', Where you divide your current Index column by 4.
Create a new Custom Column, 'ResetRows': If [DivideByFour] / [DivideByFour] = 1 then [DivideByFour] else null.
Use a fill action on your ResetRows column to fill out the empty rows, effectively grouping your rows into groups of four rows.
Finally, follow othis guide (or find another similar via Google) to create an Index which resets every time your ResetRows group value changes: PowerQuery - Index Column That Restarts Based on a Grouped Column (devcodef1.com)
_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Thanks for the idea. I tried something similar and I got the desired results .I started a column index from 0 and usd below
= Table.AddColumn(#"Added Index", "Custom", each Number.Mod([Index],4) + 1)
Thanks again!
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 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |