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 everyone,
I am facing a problem with a new report I am working on and hope to find some help oer some ideas here 😊
My source is an excel file and the data is about employee data :
Each time a person is hired, a new line is created in the Excel file, mentionning, among other informations
- the start date
- the end date
- and an employee ID
A same person can be mentioned several time (vacation work for example).
Once my file is imported, I sort it by employee code, then by date, and get something like that :
What I am trying to do :
if the employee ID is the same, I would like to compare the 'start date' of the underneath row against the 'end date' of the row above.
In example given I would like to compare :
A2 vs nothing
A3 vs B2 (A3>B2)
A4 vs B3 (A4>B3)
A5 vs B4 (A5>B4)
A6 vs B5 (A6>B5)
A7 vs nothing (new Employee ID)
A8 vs B7 (A8>B7)
A9 vs B8 (A9>B8)
A10 vs nothing (new Employee ID)
and so on
I thought, as a first step, about grouping my data on the Employee ID column and then indexing it, but actualy, I dont know if it the right thing to do or what could be the next steps 😅
Thank you for you help !
Regards
Solved! Go to Solution.
HI @amitchandak,
I thank you for your help and for your time 😊
Unfortunately, the way you told me didn't work : it worked for some of the rows but some of them didn't get the right value.
I manage to solve my problem adding a row number by group (group based on the Employee ID) and then using the EARLIER function that I didn't knew about.
Regards
HI @amitchandak,
I thank you for your help and for your time 😊
Unfortunately, the way you told me didn't work : it worked for some of the rows but some of them didn't get the right value.
I manage to solve my problem adding a row number by group (group based on the Employee ID) and then using the EARLIER function that I didn't knew about.
Regards
@Bruno_M , check if this can help
To get end date of last row for same employee you can use
a new column =
var _max = maxx(filter(Table, [Employee ID] = earlier( [Employee ID]) && [End Date] < earlier( [End Date] )), [End Date] )
return
if([Start Date] > [End Date], 1, 0)
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 |
---|---|
55 | |
54 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |