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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
MagnaNoahMcBrid
Frequent Visitor

Create Table for each Day in a Year

 

I have three Tables: 

 

Employee

Home Department

Rate

 

Home Department and Rate are child tables to Emplyoee and each have a value called "Effective Date", which determines when the Department or Rate of an Employee changed.

 

I would like to create a table for every employee with a record for each day of the year. Then I would look-up the Rate and Department that the Employee was working in at the given date based on the effective date. I would then have accurate cost allotment and rate calculations as Departments and Rates change during the year. Example

 

Employee Table       Department                                Rate

Emp 1                      Emp 1 - Dep1 - 1.1.2018            Emp 1 - Rate 1 - 1.1.2018

Emp 2                      Emp 2 - Dep1 - 1.1.2018            Emp 2 - Rate 1 - 1.1.2018

Emp 3                      Emp 1 - Dep2 - 1.2.2018            Emp 3 - Rate 2 - 1.1.2018

                                Emp 3 - Dep3 - 1.1.2018            Emp 1 - Rate 2 - 1.2.2018

 

Emp / Dept / Rate / Date Table

1.1.2018         Emp 1          Dep1         Rate 1

1.1.2018         Emp 2          Dep1         Rate 1       

1.1.2018         Emp 3          Dep1         Rate 2

1.2.2018         Emp 1          Dep2         Rate 2

1.2.2018         Emp 2          Dep1         Rate 1

1.2.2018         Emp 3          Dep1         Rate 2

1.3.2018         Emp 1          Dep2         Rate 2

1.3.2018         Emp 2          Dep1         Rate 1

1.3.2018         Emp 3          Dep1         Rate 2

 

Any advice for creating this with a query so that as Employees or Rates or Depts change, the new table changes as well.

 

1 REPLY 1
MagnaNoahMcBrid
Frequent Visitor

I have three Tables: 

 

Employee

Home Department

Rate

 

Home Department and Rate are child tables to Emplyoee and each have a value called "Effective Date", which determines when the Department or Rate of an Employee changed.

 

I would like to create a table for every employee with a record for each day of the year. Then I would look-up the Rate and Department that the Employee was working in at the given date based on the effective date. I would then have accurate cost allotment and rate calculations as Departments and Rates change during the year. Example

 

Employee Table       Department                                Rate

Emp 1                      Emp 1 - Dep1 - 1.1.2018            Emp 1 - Rate 1 - 1.1.2018

Emp 2                      Emp 2 - Dep1 - 1.1.2018            Emp 2 - Rate 1 - 1.1.2018

Emp 3                      Emp 1 - Dep2 - 1.2.2018            Emp 3 - Rate 2 - 1.1.2018

                                Emp 3 - Dep3 - 1.1.2018            Emp 1 - Rate 2 - 1.2.2018

 

Emp / Dept / Rate / Date Table

1.1.2018         Emp 1          Dep1         Rate 1

1.1.2018         Emp 2          Dep1         Rate 1       

1.1.2018         Emp 3          Dep1         Rate 2

1.2.2018         Emp 1          Dep2         Rate 2

1.2.2018         Emp 2          Dep1         Rate 1

1.2.2018         Emp 3          Dep1         Rate 2

1.3.2018         Emp 1          Dep2         Rate 2

1.3.2018         Emp 2          Dep1         Rate 1

1.3.2018         Emp 3          Dep1         Rate 2

 

Any advice for creating this with a query so that as Employees or Rates or Depts change, the new table changes as well.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors