Forum Discussion
Trend Line Disappears with Year & Week
I am trying to sort a line chart with a tend line by year & week, but it disappears when I get to this level. It only appears when i just use the week number but the sorting is incorrect. Any suggestions would be appreciated.
13 Replies
- VijayPCommunity Champion
mkohler281 Here issue is your year week column is a text column hence creating issue.
either create a year week column with as numeric data type , or add a number column to sort your year week column
then the trend line will appear! check and let me know
- mkohler281Helper I
Thank you, that was the issue with the trend line, but now after changing it to a decimal and sorting, the numbers on the X-Axis seem incorrect.
- VijayPCommunity Champion
mkohler281 Better to use whole number eg., 202304, 202305 .... so on!
Also let me what is still missing because I dont see any issue in the visual- mkohler281Helper I
Thank you, I did change it to a whole number but the same issue persists in the visual as there is no week 60 or 80 in a year. So not sure why it's showing that big gap in the data.
- VijayPCommunity Champion
mkohler281 I am not sure what is the formula you are using to get year and week
in a date Table you can create a column
year & week = year(datecolumn) *100+ weeknum(datecolumn)., then you will get either 52 or 53 weeks per year60 ,80 weeknumbers cannot be
- mkohler281Helper I
I am using concatenate for the Year and Week, but using your code gives me the same results. In the dataset there's no week 60 or 80 but it's showing up on the visual which seems odd.
- VijayPCommunity Champion
mkohler281 Frankly speaking that should not happen. You can share the pbix after removing sensitive data
- mkohler281Helper I
I don't see where I can add a file.
- mkohler281Helper I
Here's the SampleFile
- AnonymousNot applicable
Hi mkohler281
VijayP Good share!
In the dataset, there's no week 60 or week 80, but it's shown on the visual. For this problem, please try the following:
Select the year in the date field and put it on the x-axis at the same time as the number of weeks, here is the result.
Attached is a simple example that you can check it out.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.