Forum Discussion

PowerBIFreak's avatar
PowerBIFreak
Icon for Helper II rankHelper II
5 years ago
Solved

Payroll Calendar and Pay Period Numbers

Hello Folks,   I am having hard time witht this and hoping someone can help me. I'm just learning the Power BI and managed to do some calculations and create a calendar table. However, I'm not sure...
  • Jihwan_Kim's avatar
    5 years ago

    Hi, PowerBIFreak 

    Please correct me if I wrongly understood your question.

    I think, you can easily create the calendar table like below for the first four columns.

    In order to create the last column in the below picture, please try the below.

     

     

    Period Number =
    VAR currentdate = 'Calendar'[Date]
    RETURN
    "Period "
    & ROUND (
    DIVIDE (
    SUMX (
    FILTER ( 'Calendar', 'Calendar'[Date] <= currentdate ),
    IF ( 'Calendar'[Day of Week] = 1, 1 )
    ),
    2
    ),
    0
    )
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: https://www.linkedin.com/in/jihwankim1975/