Forum Discussion
Sorting rows and columns in matrix visual
- 7 years ago
hi, Deb3107
Add a conditional calculate column by dax in Summary table
For example:
For sort=IF([Trading Status] ="Pre-Start",1
IF([Trading Status] ="Established 1-3 years",2
IF([Trading Status] ="Established 3-10 years",3
IF([Trading Status] ="Established >10 years",4))))
...
If there is other attribute, keep the same logic in the formula
Then use selected [Trading Status] filed in the right fields pane->Click Sort by Column->choose the new column.
https://radacad.com/sort-by-column-in-power-bi
Best Regards,
Lin
hi, Deb3107
You could get it by using the Sort by Column button in power bi desktop, for more detail see below:
https://radacad.com/sort-by-column-in-power-bi
Best Regards,
Lin
- Deb31077 years agoFrequent Visitor
Hi v-lili6-msft
I don't appear to have the options when clicking on the 3 dots to revert back to default sort order so I get an error saying "this ccolumn can't be sorted by a column that is sorted,directly or indirectly, another column".
The table I'm trying to sort is a Summary table created by using the SUMMARIZE funtion so I can't use the Query editor either that is suggested here https://community.powerbi.com/t5/Desktop/Sort-by-another-column-error/td-p/61341
I'm at a bit of a loss of what to do now and reports need to go live this week.
- v-lili6-msft7 years agoCommunity Support
hi, Deb3107
Add a conditional calculate column by dax in Summary table
For example:
For sort=IF([Trading Status] ="Pre-Start",1
IF([Trading Status] ="Established 1-3 years",2
IF([Trading Status] ="Established 3-10 years",3
IF([Trading Status] ="Established >10 years",4))))
...
If there is other attribute, keep the same logic in the formula
Then use selected [Trading Status] filed in the right fields pane->Click Sort by Column->choose the new column.
https://radacad.com/sort-by-column-in-power-bi
Best Regards,
Lin