Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Conditional/Calculated Column for Sequencing

I have a dataset that contains annual upload information from users who use the same ID for every upload. I would like to create a conditional column (or maybe it is a calculated column?) that provides an order of reporting years for an upload, I believe this needs to happen during the data load because I need to use it for analysis and filtering. For example, looking at a datapoint in the second year of operation for all users.

 

I have

IDReporting Period Start Date
AB10012018/01/01
AB10012019/01/01
AB10012020/01/01
CD10022019/05/01
CD10022020/05/01

 

And I would like to get

IDReporting Period Start DateReport Year
AB10012018/01/011
AB10012019/01/012
AB10012020/01/013
CD10022019/05/011
CD10022020/05/012

 

but then when AB1001 uploads their 2021/01/01 report, I would want the column to then add year 4 and when CD1002 uploads 2021, it would label that 3. And then so on and so on as new reports are continually added to the database. I am having issues finding a solution since the report start dates are not the same for everyone, so I can't label everything with a 2020 year 3 which seems to be most of what I am finding online.

 

Thank you in advance.

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

There are already some good answers to this out there. I'd recommend, for example, RADACAD

https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query

View solution in original post

3 REPLIES 3
AlexisOlson
Super User
Super User

There are already some good answers to this out there. I'd recommend, for example, RADACAD

https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query

Anonymous
Not applicable

Thank you!! That worked exactly how I wanted.

Anonymous
Not applicable

Apologies about the table format, I don't know what happened. There are two columns, ID and Reporting Period Start Date in the first example and three columns, ID, Reporting Period Start Date, Reporting Year in the second

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.