Forum Discussion

g4joe's avatar
g4joe
Frequent Visitor
6 years ago
Solved

Help with displaying week numbers correctly

I've tried to figure this seemingly simple issue out but I can't !

 

 

I want to show a line chart values by fiscal week number using the table in the image. 

The top chart is how I want to show the data by fiscal week with week 1 coming after week 52.

 

The top chart x axis is type categorical sorted by the sort column - I don't want to use this because of the scroll bars and I want to add a trend line which is not possible with categorical x axis

 

The bottom chart x axis is type continuous and I've tried to sort by the sort column but it doesn't seem to work.

 

What am I missing ???

  • g4joe yes it will but there is no other way, you cannot have following sort order on number, assumg two column year and week number, if you don't year, you cannot have week no. 1 for 2011 come after week no. 4 of 2010 so you have to have some other value to sort it correctly

     

    2010 1

    2010 2

    2010 3

    2010 4

    2011 1

    2011 2

    2011 3

     

     

  • Hi g4joe , 

    This seems to be by design. So workaround is that as parry2k  mentioned, use year as legend, and use continuous x axis, or use categorical x axis, then create a measure(measure = 12 fixed value) as trend line, add this in Value field.

    Best Regards,
    Zoe Zhi

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

5 Replies

  • g4joe week column doesn't have awareness of year, and that's why, you should add a week column with year

     

    Week Year = COMBINEVALUES ( ",", Table[Year], Table[Week] )

     

    and now use this new column on x-axis

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

    • g4joe's avatar
      g4joe
      Frequent Visitor

      Hi thanks for the response.

       

      Wouldn't that force the x-axis to be categorical - which is not what I want

      • parry2k's avatar
        parry2k
        Super User

        g4joe yes it will but there is no other way, you cannot have following sort order on number, assumg two column year and week number, if you don't year, you cannot have week no. 1 for 2011 come after week no. 4 of 2010 so you have to have some other value to sort it correctly

         

        2010 1

        2010 2

        2010 3

        2010 4

        2011 1

        2011 2

        2011 3