Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a matrix visual and I'd like to be able to sort the columns in a specific order. I created a conditional column within the data table to create a numerical number based on the "Attribute" Column. (ie. If it's X, then give me X number, etc.). I went tables and then sorted the attritbute column by the AttributeSort column. However, my visual still stays in alphabetical order. Any ideas?
Solved! Go to Solution.
Hi @jcastr02,
Thank you for reaching out to Microsoft Fabric Community.
Power bi does not apply custom sort order to the fields used in the columns section of a matrix visual. Even if the column is sorted correctly in the data model, the matrix will still show the column headers in alphabetical order by default. So please follow below steps:
AttributeSortTable =
DATATABLE(
"Attribute", STRING,
"SortOrder", INTEGER,
{
{"Area Name", 1},
{"Specialty", 2},
{"Central Pharmacy", 3},
{"Midwest Specialty", 4},
{"New England Spec", 5}
}
)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Hi @jcastr02,
Thank you for reaching out to Microsoft Fabric Community.
Power bi does not apply custom sort order to the fields used in the columns section of a matrix visual. Even if the column is sorted correctly in the data model, the matrix will still show the column headers in alphabetical order by default. So please follow below steps:
AttributeSortTable =
DATATABLE(
"Attribute", STRING,
"SortOrder", INTEGER,
{
{"Area Name", 1},
{"Specialty", 2},
{"Central Pharmacy", 3},
{"Midwest Specialty", 4},
{"New England Spec", 5}
}
)
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
I don't have ability to sort by attribute either.
@samratpbi apologies for confusion the AttributeSort column was created in Power Query, then I went to Tables and did the Sort by columns but it's still not ordering the information in the sort order I designated.
Hi, sorting the table view will not sort your data. In this case, better to create that AttributeSort column using Power Query. Then in the table view, select Attribute column use the feature "Sort by Column" and select AttributeSort column. That will sort your Attribute column in all the visuals wherever being used.
Hope this helps to resolve your problem; if it does, then please mark it as solution and dont forget to give kudos.
Thanks - Samrat
I don't have ability to "sort by" attribute....
User | Count |
---|---|
59 | |
59 | |
56 | |
38 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
39 |