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

Restart Pay Period Counting After 26th Pay Period

Hello!

 

I have a calendar with the corresponding Pay Period (Biweekly) which I did by using: 

 

Pay Period Number = FLOOR ( DATEDIFF ( DATE ( 2017,12,23 ), 'Biweekly (Pay Period)'[Date],DAY )/14,1)+1 

 

But the problem is that after the 26th instance it continues with the counting. I need it to start back at 1 after the 26th period, basically creating a cycle from 1 to 26.

 

Thank you! Cheers!

 

Calendar with Pay Period NumberCalendar with Pay Period NumberPay Period Last InstancePay Period Last Instance

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @PatrickLamoste

 

Based on what you already have, try adding the MOD function:

 

Pay Period Number =
MOD (
    FLOOR (
        DATEDIFF ( DATE ( 2017; 12; 23 ); 'Biweekly (Pay Period)'[Date]; DAY ) / 14;
        1
    );
    26
)
    + 1

Although in this case your data is easy and quick to replicate, it is always best to show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and increases the likelihood of your question being answered.

 

Cheers

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @PatrickLamoste

 

Based on what you already have, try adding the MOD function:

 

Pay Period Number =
MOD (
    FLOOR (
        DATEDIFF ( DATE ( 2017; 12; 23 ); 'Biweekly (Pay Period)'[Date]; DAY ) / 14;
        1
    );
    26
)
    + 1

Although in this case your data is easy and quick to replicate, it is always best to show your sample data in text-tabular format in addition to (or instead of) the screen captures. That allows people trying to help to readily copy the data and increases the likelihood of your question being answered.

 

Cheers

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.