0
votes

I have a line graph in PowerBI and in my date dimension I have the Week Number for every date (note that this is a custom week number with the week starting on Friday).

Whenever I put it on a the x-axis, PowerBI groups all the weeks together, regarless of year... so Week 1 of year 2015 will be grouped together with Week 1 of 2016...

I think to myself: "Ok, no problem, I'll just add the Year after every week number so I'll have 1-2016, 2-2016, and so on."

Well PowerBI sees this concatenation as a string value so when I put that on the graph, it goes

1-2016, 1-2017, 2-2016, 2-2017, 3-2016, 4-2016, and so on....

I've tried sorting the new column by the old week number column, but it does the same thing. Any suggestions on how to accomplish this?

1

1 Answers

0
votes

You're on the right track. I recommend a separate (hidden) sort column that sorts alphabetically (i.e. year first, then 2 digit week). In other words, 1-2016 = 201601.

This way, all the weeks for 2016 sort before the weeks for 2017, and the weeks sort in the right order too. (A 1 digit week would mean 20161 will be followed by 201610, which you don't want either.)