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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rayishome
Resolver I
Resolver I

Trend by Week of Year

Seems like an easy concept to solve, but it's proven to be harder than expected.

 

Options I've Tried:

  1. Date Hierarchy:  This doesn't have a weeks level
  2. Use WeekNum:  This works great until you cross years
  3. Creating a Column to concatenate Year and WeekNum as a string: Trendlines are not an option for strings
  4. Creating a Column to concatenate year and WeekNum as a Int: When crossing years the continuous value does not understand 201652 and 201701 are next to each other creating gaps.

 

The goal is to create a line chart that provides a Trend Line and a Forecast summarizing by Week of the year that will span multiple years.  

 

Thanks

1 ACCEPTED SOLUTION

Thanks!  The Hierarchy didn't work as it's switched from Continuous to Categorical.  However, using Query: Week = Date.StartOfWeek([Date]) did create a grouping level by week I was able to use.  Thanks

View solution in original post

4 REPLIES 4

One option you haven't tried is to make your own date hierarchy.  Simply drag Year, Qtr, Mnth, Week etc. in order to you axis field and see if that allows you to view the weekly trend without the other issues you described.  You will have to expand your axis (part of the drill down experience) and it should keep track of the levels of the hierarchy as part of the axis labeling.

Thanks!  The Hierarchy didn't work as it's switched from Continuous to Categorical.  However, using Query: Week = Date.StartOfWeek([Date]) did create a grouping level by week I was able to use.  Thanks

This worked very well. It was so clever and elegant, thank you! 

For those wondering, you can just add the new date into the axis field.

The sad part is that we now don't get the Week Number in the Axis, but got it in the Tooltip.

I ran into a similar challenge and wanted to share my solution. I have a [Date] column which I want to group by weeks across multiple years and use for chart axes.

 

First created a calculated column WeekNum = weeknum([Date]). On the chart place the [Date] field on the axis, using date hierarchy and keeping only Year, then place WeekNum underneath. It was sorted incorrectly at first. I had to sort multiple times before the desired order came up (oldest <--> newest).

 

Capture.PNG

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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