cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MClipsham92 Frequent Visitor
Frequent Visitor

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, 

1 ACCEPTED SOLUTION

Accepted Solutions
HotChilli New Contributor
New Contributor

Re: Classifying a conditional Column as the Index

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

View solution in original post

5 REPLIES 5
HotChilli New Contributor
New Contributor

Re: Classifying a conditional Column as the Index

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

MClipsham92 Frequent Visitor
Frequent Visitor

Re: Classifying a conditional Column as the Index

Hi HotChilli,

 

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

 

This is what the Line Graph is doing:

 

xzdgf.PNG

 

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 New Contributor
New Contributor

Re: Classifying a conditional Column as the Index

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

View solution in original post

MClipsham92 Frequent Visitor
Frequent Visitor

Re: Classifying a conditional Column as the Index

Excellent thanks, that seems to have sorted it, the issue must have been that I needed to delete and remake the Visual.

 

Thanks,

ottmarw New Member
New Member

Re: Classifying a conditional Column as the Index

Hi,

 

I also have some trouble with matching the Index Column. 

Can you help me?

 

Thanks in advance

 

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 66 members 1,293 guests
Please welcome our newest community members: