Forum Discussion
YuanG
10 years agoHelper I
Show data by week number
Hi Everyone, I'm working on a line chart with some data calcul by week ,and i want the data not show in format dd/mm/yyyy, but with the number of weeks in year. Like this chart, in 27 June 20...
- 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/
Greg_Deckler
10 years agoCommunity Champion
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.
sxlubinoff
9 years agoRegular Visitor
I 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 ?