Forum Discussion
Show data by week number
- 10 years ago
The calendar is separate and more useful that way. In fact, having your week numbers in your fact table may be throwing off the calculation and sort. While I don't have time to fully explain this, at this time, I wanted to at least respond and share a link that could help.
https://www.sqlbi.com/articles/week-based-time-intelligence-in-dax/
Not quite clear on the issue but you can create a week number from a date field using a calculated column such as:
WeekNum = WEEKNUM([Date])
Then you can create a column like:
Week = "Week " & [WeekNum]
Set your sort by for this column to the "WeekNum" column and then use the "Week" column in you Axis.
- sxlubinoff9 years agoRegular VisitorI follow what you advised below, however, what if I have data from different years?? Sort I have been trying is not working ..for example : I have 2016- (WK)51 /2016-(WK)52 / 2017-(WK)1 / 2017-(WK)2 ...as soon I uploaded 2017- (WK)10 problems started.. Now the sort is showing : 2016-51 / 2016-52 / 2017-1 /2017-10 / 2017-2.... Would you please advise how to resolve it ?
- YuanG10 years ago
Helper I
Hi Greg_Deckler
First of all, thanks for the reponse.
With the column Week, when i creat a line chart, it will not in the right ordre, i've try to make the week number in type character, but it not works, so do you know how can i do with this?
- Greg_Deckler10 years ago
Community Champion
YuanG - Select your Week column to have a "Sort By" of your WeekNum column.
- YuanG10 years ago
Helper I
- sxlubinoff9 years agoRegular Visitor
Hello,
Hope you can help me.
What if I need to sort weeks from different years ?
Example _
2016 (WK) 51- 2016 (WK) 52 - 2017 (WK) 1 - 2017 ( WK) 2 ) ...Sort problems started when I upload data for 2017 (WK )10
Now sort is showing as below :
201651 -201652 - 201701-201710-20172-20173-20174 ....
Hope you can help me to resolve it ..I tried everything..!!
- cmonnette9 years agoNew Member
Have you been able to resolve this? I am having the same issue sorting weeknumbers across multiple years.
- cmonnette9 years agoNew Member
Have you been able to resolve this? I am having the same issue sorting weeknumbers across multiple years.
- cmonnette9 years agoNew Member
I was able to resolve this by adding the following column to my data table and then sorting in default order.
"WorkWeek", YEAR([date]) & format(WEEKNUM ( [Date] ),"00")