Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I am dealing with survey data (Questions and Answers). My particular problem is sorting the questions in order after unpivoting.
When I unpivot all the questions they get placed in a new column called "attributes" and the loose their question in order. I would like to change this so that in the graph they are in order from 1 to the last question. I tried doing something like adding a new table with the questions and a order # with a relation but that didnt work for me. Is there a way to achieve something like this?
Questions graph(Stacked bar): (Not correct order)
Un-ordered Questions example:
This is the way the questions get put in the attributes column after unpivoting
I would like change the order to this:
1 - Question1
2 - Questio2
etc.
Thank you!
Solved! Go to Solution.
I figured it out. The values quere different from each other in the relational table and that is why ti wasn't working.
Thanks for the help!
hi, @Anonymous
You could use Sort by column in Power BI Desktop to achieve your requirement.
Before it, you need to add an index column for attributes column by your logic.
Best Regards,
Lin
@v-lili6-msft Thanks for the suggestion.
I have created an index column and attempted to sort by that order but it doesn't work as intended. What it does it assigns a duplicate numbers to the answer rows and that is making the order wrong. I also tried to use the related table with just the answers and a index column and that does not work ether. Any other ideas?
Here is how the data is being ordered:
Thanks again.
I figured it out. The values quere different from each other in the relational table and that is why ti wasn't working.
Thanks for the help!
What did you do to sort the mixed data types? Could you please state the solution? I am having the same issue here.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 47 | |
| 44 | |
| 20 | |
| 20 |
| User | Count |
|---|---|
| 73 | |
| 72 | |
| 34 | |
| 33 | |
| 31 |