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.
Hi, I have a table with three columns like this : Year, Name, Budget.
I would like to iterate over the rows in order to get a new column representing the number of rows in the complete table that has a year between the year of the current row minus one and the year of the current row minus five.
So the condition for the row count is also row based.
How can I do that please ?
Thanks 👍
Hi, @MoaMaime
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Well data are really simple, for example as follow. I added the wanted column (named ColumnWanted) at the far right with the wanted values for this example.
Year | Name | Budget | ColumnWanted |
2019 | A | 159 | 2 |
2021 | B | 147 | 1 |
2014 | C | 123 | 0 |
2015 | D | 59 | 1 |
Thank you !
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 |
---|---|
58 | |
56 | |
56 | |
38 | |
29 |
User | Count |
---|---|
75 | |
62 | |
45 | |
40 | |
40 |