Reply
jayceeb
Helper I
Helper I
Partially syndicated - Outbound

WEEKLY TRENDS comparison

Hi, I have daily data entry I just want to get the weekly trends comparison example my data is 

DateQuantity
1-Jan1
2-Jan1
3-Jan1
4-Jan1
5-Jan1
6-Jan1
7-Jan1
8-Jan1
9-Jan1
10-Jan1
11-Jan1
12-Jan1
13-Jan1
14-Jan1
1-Feb2
2-Feb2
3-Feb2
4-Feb2
5-Feb2
6-Feb2
7-Feb2
8-Feb2
9-Feb2
10-Feb2
11-Feb2
12-Feb2
13-Feb2
14-Feb2

  I want my result to show like this if i select the date filter . is it possible to put it in graph as well? please help. Thank you:)

MonthWeekTotal
Jan 1-Jan 7week 17
Feb 1- Feb 7week 114
Jan 8-Jan 14week 27
Feb 8- Feb 14week 214
1 ACCEPTED SOLUTION

Syndicated - Outbound

Hi @jayceeb ,

In Power BI Desktop, if you want to use a DAX statement after selecting a date, you need to strictly follow the Week rule on the calendar to do so. 

WeeklyTotal = 
CALCULATE(
    [TotalQuantity],
    ALLEXCEPT('Table', 'Table'[MonthYear], 'Table'[WeekNumber])
)

vyilongmsft_0-1738742581997.png

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yilong-msft
Community Support
Community Support

Syndicated - Outbound

I create a table as you mentioned.

vyilongmsft_3-1738637428976.png

Then I create two calculated columns and here are the DAX codes.

WeekRange =
VAR StartOfWeek =
    'Table'[Date] - WEEKDAY ( 'Table'[Date], 2 ) + 1
VAR EndOfWeek = StartOfWeek + 6
RETURN
    FORMAT ( StartOfWeek, "MMM d" ) & " - "
        & FORMAT ( EndOfWeek, "MMM d" )
 
WeekNumber =
"week "
    & WEEKNUM ( 'Table'[Date], 2 ) - WEEKNUM ( STARTOFMONTH ( 'Table'[Date] ), 2 ) + 1
vyilongmsft_4-1738637500138.png

Next I think you can create a new table.

WeeklyTrends =
SUMMARIZE(
    'Table',
    'Table'[WeekRange],
    'Table'[WeekNumber],
    "Total", SUM('Table'[Quantity])
)
vyilongmsft_5-1738637650399.png

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Syndicated - Outbound

hi i got it however the date is not arrange.

jayceeb_1-1738736286507.png

 

i use the sorting but still mixed. and in the table wek1 and week 6 is the same date. i also use filter for the dates.  how to arrange the date please.

jayceeb_3-1738736519921.png

 

 

 

 

Syndicated - Outbound

Hi @jayceeb ,

In Power BI Desktop, if you want to use a DAX statement after selecting a date, you need to strictly follow the Week rule on the calendar to do so. 

WeeklyTotal = 
CALCULATE(
    [TotalQuantity],
    ALLEXCEPT('Table', 'Table'[MonthYear], 'Table'[WeekNumber])
)

vyilongmsft_0-1738742581997.png

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Syndicated - Outbound

@jayceeb , You have create week columns in you table

 

Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],1)+1 //Sunday

 

Week Start date Monday = 'Date'[Date]+-1*WEEKDAY('Date'[Date],2)+1 //Monday

 

Week End date = [Week Start date] +6

format and use in other column

 

You can check here

https://www.youtube.com/watch?v=cyWVzAQF9YU&t=40648s


Any Weekday Week - Start From Any day of Week
https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Powe...
https://medium.com/chandakamit/cheat-sheet-any-weekdays-week-start-date-just-one-variable-apart-6b2e...

 

Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8

 

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)