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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bwelsh
Helper I
Helper I

Adding Pay Period to Date Dimension Table

Hello,

 

I have a date dimension table and I need to add a column for pay period end date each date in the table ends on. How would I go about doing this? Generally (in excel) I would set the first static pay period end date and simply count up from there, however this date dimension table is dynamic so I wont be able to do that. Our last bi-weekly pay period ended on April 28th.

1 ACCEPTED SOLUTION

@bwelsh

 

In this scenario, you can create a calculated column to display the pay period number based on the first pay period start date. Then you can calculate the max date within same pay period group.

 

I use 2017/4/29 as the first pay period start date.

 

1. Create a calculated column like below;

 

pay period number = FLOOR(DATEDIFF(DATE(2017,4,29),'Table'[Date],DAY)/14,1)+1

5.PNG

 

 

2. Then create a column to get the pay period end date.

 

pay period end date = CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[pay period number]))

6.PNG

 

 

Regards,

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @bwelsh

Can you post a pic of your data and a pic of the desired output?

 

This is my date dimension table. I need to create a column (based on the first column) that shows the last date of the pay-period.

 

Capture.PNG

@bwelsh

 

In this scenario, you can create a calculated column to display the pay period number based on the first pay period start date. Then you can calculate the max date within same pay period group.

 

I use 2017/4/29 as the first pay period start date.

 

1. Create a calculated column like below;

 

pay period number = FLOOR(DATEDIFF(DATE(2017,4,29),'Table'[Date],DAY)/14,1)+1

5.PNG

 

 

2. Then create a column to get the pay period end date.

 

pay period end date = CALCULATE(MAX('Table'[Date]),ALLEXCEPT('Table','Table'[pay period number]))

6.PNG

 

 

Regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.