Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

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. 

 

이미지 4123.png

 

10 REPLIES 10
Anonymous
Not applicable

check below thread.

 

https://community.powerbi.com/t5/Desktop/BUG-WEEKNUM-not-working-as-expected-week-of-new-year/td-p/5...

 

Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar

If I resolve your problem Mark it as a solution and give kudos.

AlB
Community Champion
Community 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
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.

 

이미지 52222.png

 

AlB
Community Champion
Community 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]
)

Anonymous
Not applicable

 

How to  change the DAX expression like adding expression of changing 53th of 2020 into 1st week of 2020?

 

thanks again

AlB
Community Champion
Community Champion

@Anonymous 

Try this for your column WeekYear

 

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

 

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

Cheers  Datanaut

 

Anonymous
Not applicable

Thank you for your answer.

But my question was

How should i add more years on the DAX expression?

For example 2021, 2022...

 

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]
)

AlB
Community Champion
Community Champion

 

@Anonymous 

Try this

Week of the year 2 V2 =
IF ( Table1[ Week of the year] = 53; 1; Table1[ Week of the year] )

 

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

Cheers  Datanaut

AlB
Community Champion
Community Champion

 

With the code for WeekYear in the previous post, you don't need the [Week of the year 2] column any more

 

 

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

Cheers  Datanaut

 

 

 

Anonymous
Not applicable

oh it was my mistake. Thank you very much again. 😊 You saved me.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.