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
Anonymous
Not applicable

DAX Calendar Pay Periods

I have the following calendar imported into DAX; how can I custom write new columns that indicate pay period number for each specific year?  For example a starting range that can go both forwards and backwards would be  Payperiod Begininning Date = 01/09/2021 and the end of it was 1/22/2021.  How can I write this to where I can have a column that shows the pay period number to side?

 

JMcAnarney_0-1660587787570.png

 

3 REPLIES 3
PaulDBrown
Community Champion
Community Champion

How do you define the pay period?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Anonymous
Not applicable

Every two weeks is this what you mean? i.e. a first day would be 12/26/2020 last day would be 1/08/2021

AUaero
Responsive Resident
Responsive Resident

You could probably figure out a way to do this with DAX, assuming that your pay periods are always two weeks.  I even started trying to figure it out, but then I asked "If I were solving this problem myself, how would I do it?"  Honestly, it's probably faster and easier to either:

  1. Bang out a calendar table inclusive of your pay period column in Excel and then copy the calendar table into your data model, or
  2. Create a table in your data model to define the pay periods and merge it to your existing calendar table in Power Query (assuming your calendar table isn't defined by DAX)

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.