Forum Discussion
Column chart based on filter selection
- 5 years ago
Anonymous , If it is a column. Create one more column, in the same manner, having sort order of these columns and mark that as a sort column
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
Anonymous , If it is a column. Create one more column, in the same manner, having sort order of these columns and mark that as a sort column
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
This method is not working in this case, each column of the switch has a specific column to determine its order, here's an example:
The column highlighted in red "Termina Quinta" is ordered by the column highlighted in green "IQuinta", the column highlighted in purple "Termina Segunda" is highlighted by the column highlighted in blue "ISegunda", the same goes for the other columns.
The column that is used in my graph depends on the selection I make in the filter, for example, if I select "Termina Segunda" in the filter the graph will use the column Dim_Calendario [Termina Segunda] in the graph, following image to illustrate:
The column used in the graph is generated by the formula:
Semana Selecionada =
SWITCH('Semanas x Datas'[Semanas],
"Termina Segunda", RELATED(Dim_Calendario[Termina Segunda]),
"Termina Terça", RELATED(Dim_Calendario[Termina Terça]),
"Termina Quarta", RELATED(Dim_Calendario[Termina Quarta]),
"Termina Quinta", RELATED(Dim_Calendario[Termina Quinta]),
"Termina Sexta", RELATED(Dim_Calendario[Termina Sexta])
)
When I select the column in the filter the graph shows the respective column but in a totally random order, it does not respect the order that I determined for the columns in the table "Dim_Calendario".