I have a table:
<
I want to visualize the data by ATTRIBUTE. I created an INDEX to sort the text field. This is the view I want.
But when I remove the INDEX, the table looks like this:
I’m sure the solution is simple, but I cannot figure it out.
Any suggestions?
BrianJ
December 3, 2019, 5:11am
2
@rizzotony ,
Welcome to the forum!
Really quick fix here:
Step one: in the Data View click on the Attribute column
Step two: under Column Tools, click on Sort by Column and choose Index
This will keep your Attribute column properly sorted, whether you have index in the table visual or not.
1 Like
Thank you, Brian!
What is tripping me up with your solution is the ATTRIBUTE column has identical values.
When I go to sort by INDEX, I receive an error message.
Will I have to create multiple tables by BRANCH to achieve the result I’m looking for without showing INDEX in the visual?
BrianJ
December 4, 2019, 1:18pm
4
@rizzotony ,
No, we can definitely get this to work within one table without the index in the visual.
Can you please post your PBIX file? I’ve got two different ideas on how best to handle this, and I want to test which one works better on your data.
Thanks.
ankit
December 4, 2019, 4:13pm
5
Hi @rizzotony .
For Custom Sorting, I always prefer to use a MasterSort Table. Based on your data, I have created a new Table as below. (You can also create this table manually with Index 1,2,3 using Enter Data or DAX)
SortAttributeTable =
SUMMARIZECOLUMNS (
'DataTable'[ Attribute],
"SortIndex", SUM ( 'DataTable'[Index] )
)
In Master table, we can Sort Attribute Column by SortIndex and use it in our Visuals.PF sample PBIX file attached. Let me know in case of any queries.
Solution - rizzotony.pbix (28.2 KB)
Thanks
Ankit Jain
3 Likes
BrianJ
December 4, 2019, 5:01pm
6
@ankit ,
Nice. I was working this using CONCATENATE() to create the sort index in a calculated column in the Data table, but I like your approach better- cleaner and simpler.
@ankit & @BrianJ -
THANK YOU! Such a simple solution that has wide application.
Tony
1 Like