Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Current & previous months

Hi All,

Does anyone know how to find current period and previous period total sales  by making your data table autoupdate? 

For example, the first pay period starts from 1st to 15th of each month and second pay period is from 16th to EOMONTH. This means that the "CURRENT MONTH" can fall into one of two pay periods. 

I need my date table to identify whether the pay period is in P1 or P2, and accordingly assing "CURRENT MONTH" label. The month prior to "current month' will have label "PREVIOUS MONTH".

Cannot figure out how to do this. Is anyone able to help?

Thanks all

  • Hi Anonymous 

    My understanding is that you need something like below.

    pay period = 
    IF( DAY( 'Table'[Date] ) <= 15, "P1", "P2" )

    If not please please can you create a sample with the outcome that you are expecting.

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

2 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi Anonymous 

    My understanding is that you need something like below.

    pay period = 
    IF( DAY( 'Table'[Date] ) <= 15, "P1", "P2" )

    If not please please can you create a sample with the outcome that you are expecting.

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski

     

  • v-diye-msft's avatar
    v-diye-msft
    Community Support

    Hi Anonymous ,

     

    If above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!