Forum Discussion

MClipsham92's avatar
MClipsham92
Frequent Visitor
7 years ago
Solved

Classifying a conditional Column as the Index

Hello All,

 

I'm having a small issue, I've got some survey data that I am trying to put into a Line Graph, however when I do it the points on the x axis (Start of programme, week 12, week 24, end of programme etc) are all in the wrong order. I figured I could create an index column for this, so I've created a conditional column in the query editior that is a series of IF statements that gives the rows a number 1 to 12  (IF Attribute equals Start of Programme then 1 etc).

 

The issue I have is I can't seem to find the button classify this solumn as the index, any help?

 

Thanks, 

  • HotChilli's avatar
    HotChilli
    7 years ago

    I've had a play about with your data and i was able to get it to work.

    I created the Line Chart. It looked like your version.

    I changed the 'sort by' to Index. Looked the same.

    It won't change the order if the visual already exists unless you remove the attribute or score from the field well.  If you remove it and add it back in, it should follow the 'sort by' order

5 Replies

  • HotChilli's avatar
    HotChilli
    Icon for Community Champion rankCommunity Champion

    Are you looking for the 'sort by' function on the Modelling tab of power bi desktop?

    • MClipsham92's avatar
      MClipsham92
      Frequent Visitor

      Hi HotChilli,

       

      That doesn't seem to work I'm afraid. 

       

      This is what the Line Graph is doing:

       

       

      As you can see for some reason Instructor Score 2 is coming up before Instructor score 1 whereas they should be the other way round.  

       

      The data looks like this:

       

      Student    Attribute                Score   Index

       

      xxxx          Instructor score 1     7        1 

      xxxx          Instructor score 2     12      2

       

      The 'sort by column' drop down already has the Index column ticked.

       

      Thanks,

      • HotChilli's avatar
        HotChilli
        Icon for Community Champion rankCommunity Champion

        I've had a play about with your data and i was able to get it to work.

        I created the Line Chart. It looked like your version.

        I changed the 'sort by' to Index. Looked the same.

        It won't change the order if the visual already exists unless you remove the attribute or score from the field well.  If you remove it and add it back in, it should follow the 'sort by' order