Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CDiepeveen
Regular Visitor

Sorting the x-ax by number

Hello all,

 

I have a problem with sorting the x-ax of my graph.

See the screenshot.

 

The 10 is between the 1 and the 2, however, I need the 10 to be after the 9. 

Can anyone help me with this problem?

 

Thanks in advance!

 

Regards,

Cornee

 

grafiek-voorbeeld.JPG

1 ACCEPTED SOLUTION

@CDiepeveen you can add a number column let's call it "sort answer" for each corresponding answer and sort your existing answer column with this new "sort answer" column in modelling tab. It will give you the result you are looking for.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@CDiepeveen seems like the column you are using on x-axis is of type string, change its data type whole number and it will work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks for your response parry2k.

 

However, it does not seem to be possible to change this data type.

Could this be the case when the data is uploaded in PowerBI by an self made API?

 

The data is extracted from a website with several questionaires. A single questionaire has several kind of "data-type" answers: text and numbers.

@CDiepeveen are you saying that column you currently have on x-axis does also contains text for example like this.

 

1

2

3

10

11

Yes

No



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

No, its not like that.

 

For example, the questionaire has 10 questions. 

- 2 questions with yes/no answers

- 2 questions with name/adress

- 6 questions where you give a rating from 1 to 10

 

In powerBI we made 1 table for questions with the question and a question ID.

All the answers are put in another table with the corresponding question ID.

 

In de graph I showed earlier I filtered the answers. However, the main table consists all answers.

 

Is it better to make different tables with the power query instead of using the entire table?

@CDiepeveen you can add a number column let's call it "sort answer" for each corresponding answer and sort your existing answer column with this new "sort answer" column in modelling tab. It will give you the result you are looking for.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank you @parry2k. We solved the problem by adding such a column.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.