March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi guys, i need some help
I have a table with Start Date and End Date for each employee
I need to create one row for each day between these two date, repeating the employee names.
Is there a way to do that?
Solved! Go to Solution.
I had a similar usecase within my work environment and I solved this using M powerquery.
They idea is to create a list with dates between the start data and the enddate
You can create a new column containing the list with dates as followed:
I had a similar usecase within my work environment and I solved this using M powerquery.
They idea is to create a list with dates between the start data and the enddate
You can create a new column containing the list with dates as followed:
Do you mean if the enddate is null? You could choose to replace those values with the date from DateTime.LocalNow from https://learn.microsoft.com/en-us/powerquery-m/datetime-localnow
If that isn't what your saying could you then provide a small example table with dummy data
Add 1 to the "Count" parameter:
List.Dates([Start], Duration.Days([End] - [Start])+1, #duration(1,0,0,0))
You could create a calculated table in DAX
Employee dates =
SELECTCOLUMNS (
GENERATE ( Employee, CALENDAR ( Employee[Start date], Employee[End date] ) ),
"Employee first name", Employee[First name],
"Employee last name", Employee[Last name],
"Date", [Date]
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
20 | |
12 | |
10 | |
9 | |
7 |
User | Count |
---|---|
40 | |
26 | |
16 | |
16 | |
11 |