Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Weekly sales

Hello everybody

 

i need question

I am showing sales data  by weekly.

I m showing my data by  WeekYear

 

And it shows:

Last days of Year end  2019.12. 29 - 31 (3 days) are 53rd week of 2019

2020.01.01 - 04 (4days) sales are 1st week of 2020

 

But my customer want to see combine these days in one week 

 

Is there any method to show not  divided like this?

 

For example: 2019.12.29 - 2020.01.04  is 1st week of 2020

 

 

Thanks always. 

 

 

10 Replies

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    Using what you already have, you could create a new calculated column:

    Week of the year 2 =
    IF (
        ( Table1[year] = 2019 && Table1[ Week of the year] = 53 )
            || ( Table1[year] = 2020 && Table1[ Week of the year] = 1 );
        1;
        Table1[ Week of the year]
    )
    

     

    What we are doing is imply assign week number 1 to both week 53-2019 and week 01-2020 and leave all the rest as it already was.

     

    Please mark the question solved when done and consider giving kudos if posts are helpful.

    Cheers  Datanaut

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello

      Thank you very much for your answer.

      I used your DAX expression. But it shows same as before. Or i made mistake with my expression.

       

       

      • AlB's avatar
        AlB
        Icon for Community Champion rankCommunity Champion

        Hi Anonymous 

        You haven't copied my code correctly. The second check is on [Week of the year], not on [year]

         

        Week of the year 2 =
        IF (
        ( Table1[year] = 2019 && Table1[ Week of the year] = 53 )
        || ( Table1[year] = 2020 && Table1[ Week of the year] = 1 );
        1;
        Table1[ Week of the year]
        )