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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Stacked column filtered on last 12 weeks gives problem during crossover of years

Hello everyone

 

I have a chart with stacked columns. I added a relative filter to the chart so it only shows data of the last 12 weeks. On the X axis I have my weeks in numbers 1,2,3,4,......, 52. 

 

Due to the crossover of 2019 to 2020 my chart looks like in the added picture. How can I fix this so that de first weeks of the new year show at the right of the last weeks of last year?

 

Thanks in advance for the help!!

 

The left 2 bars are the first 2 weeks of 2020. They should appear to the right of the last weeks of previous year.The left 2 bars are the first 2 weeks of 2020. They should appear to the right of the last weeks of previous year.

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

You could try to create a new column of "Year-Week" as a x-asix. It might be not implemented directly for the asix of week. Please follow the steps and check if it is what you want.

  • Create a calculated column and change the data type to Whole number
Year-Week = 'Table'[Date].[Year]&FORMAT(WEEKNUM('Table'[Date]),"0#")

 2.PNG

  • Drag it to x-asix and sort the visual by the new column.

3.PNG

 

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

6 REPLIES 6
amitchandak
Super User
Super User

you need to have year context added to get sorted correctly

Anonymous
Not applicable

How can I do this?

Hi @Anonymous ,

You could try to create a new column of "Year-Week" as a x-asix. It might be not implemented directly for the asix of week. Please follow the steps and check if it is what you want.

  • Create a calculated column and change the data type to Whole number
Year-Week = 'Table'[Date].[Year]&FORMAT(WEEKNUM('Table'[Date]),"0#")

 2.PNG

  • Drag it to x-asix and sort the visual by the new column.

3.PNG

 

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you. This works.

 

Is there a way that I make it so only the week number shows on the axis?

Hi @Anonymous ,

If you want to add only the week number into the axis, you could change the type to Categorical. However, the week number will be shown based on the number rahther than the actual date.

4.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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