Forum Discussion
Sort By in the Visual
sprasad Try creating a unique key field as a supporting field for sorting, for each combination of fields that you want to sort on. Then, use that new field as your sorting column.
Explain a bit on how do it?
Take this example
| Database | Operating System | Browser |
| Oracle 11g | Windows 10 | Chrome |
| SQL Server 2016 | Windows Server 2012 | Chrome |
| SQL Server 2016 | Windows 10 | Chrome |
| SQL Server 2016 | Windows 10 | Safari |
| SQL Server 2014 | Windows 10 | IE |
| Oracle 12c | Windows 10 | Chrome |
| Postgres | Windows 10 | IE |
| SQL Server 2016 | Windows 10 | Chrome |
| SQL Server 2016 | Windows 10 | Chrome |
| SQL Server 2016 | Windows Server 2016 | Chrome |
| SQL Server 2016 | Windows 10 | Safari |
| SQL Server 2016 | Windows 10 | Chrome |
| SQL Server 2016 | Windows 10 | Chrome |
| SQL Server 2016 | Windows 10 | Chrome |
| SQL Server 2016 | Windows 10 | Chrome |
- v-juanli-msft7 years agoCommunity Support
Hi sprasad
In this example, do you want the "Database" sorted by "Operating System" and "Browser" as below?
Which visual do you need to sort as your said?
Which columns do you add in the visual? one column or serveral columns?
Best Regards
Maggie
- sprasad7 years agoHelper II
Maggie,
I need to all all the 3 coulumns in the visual and I should do the sorting of Database and Operating system.
Thanks
Sudhir
- v-juanli-msft7 years agoCommunity Support
Hi sprasad
one workaround is create a calcuated column
Column = [Database]&[Operating System]
add this column in the table
click on the column header to select "desc"/"asc".
If you want sort by first column ASC and sort by second column DESC.
you could create rank measures to sort by.
for example.
create measures, then click on "rank3" measure header to sort
Measure1 = MAX(Table1[Database]) Measure2 = MAX(Table1[Operating System]) Rank1 = RANKX(ALL(Table1),[Measure1],,ASC,Dense) Rank2 = RANKX(ALL(Table1),[Measure2],,DESC,Dense) Rank3 = [Rank1]&[Rank2]
Best Regards
Maggie