cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
robhel Regular Visitor
Regular Visitor

Duplicate Rows based on Date & Frequency - Power Query

Hello PBI Gurus,

 

I am after your assistance with a query that can duplicate rows based on date & frequency of occurance to generate a work schedule calendar, where an employee has different schedules, eg work a 9 day fortnight, part time Mon to Thur, Weekends, etc.

 

Data contained in first excel sheet from a single row to duplicate the row at each date occurance, with the end result a visual calendar of employee availability 

 

Example.pnghttps://drive.google.com/open?id=162619nHpiwsW6IytsnLhs0mbzNl-hmOHCalendar.png

 

Appreciate any assistance with this one as with my initial calendar, I entred RDO frequency manually for a small hanful of employees and is not viable for the scale of data I have for 1500 employees and frequency of schedules to change.

 

1 ACCEPTED SOLUTION

Accepted Solutions
robhel Regular Visitor
Regular Visitor

Re: Duplicate Rows based on Date & Frequency - Power Query

I managed to figure it out (there maybe a better way of doing it thou).......

 

I added an Index column against each individual entry and then added a new column:

 

=List.Dates(Date.AddDays([EventDate],[#"Frequencey"]),[Occurance],Duration.From(#"Frequency"]))

 

And it worked

View solution in original post

1 REPLY 1
robhel Regular Visitor
Regular Visitor

Re: Duplicate Rows based on Date & Frequency - Power Query

I managed to figure it out (there maybe a better way of doing it thou).......

 

I added an Index column against each individual entry and then added a new column:

 

=List.Dates(Date.AddDays([EventDate],[#"Frequencey"]),[Occurance],Duration.From(#"Frequency"]))

 

And it worked

View solution in original post

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 6 members 3,406 guests
Please welcome our newest community members: