Forum Discussion
multiple column in one slicer
Hello there, I have a question. Let say the table is:
| Equipment | Voltage | Red cable | Blue cable | Yellow cable |
| TRU 1 | 6.6kV | 0.23 | 0.45 | 0.65 |
| TRU 2 | 6.6kV | 0.32 | 0.5 | 0.7 |
| TRU 3 | 6.6kV | 0.4 | 0.56 | 0.75 |
Then, I want to put 3 columns in one slicer, show list of :
Slicer :
- Red cable
- Yellow cable
- Blue cable
Then, when I click Red cable, the data in Red cable will display on line chart. Then, If I click yellow cable, then the line chart will display yellow cable data only. Same as blue cable also.
Hope you can help me. thank you in advance.
- Anonymous4 years ago
Hi abgnfirdaus ,
It is not supported to use column header as slicer and use DAX to get column header.
You could try following methods.
1# Open Query Editor, select these 3 columns and use Unpivot Columns feature.
2# Create a calculated table by using below formula:
Table 2 = UNION( SELECTCOLUMNS('Table 1',"equipment",'Table 1'[Equipment],"voltage",'Table 1'[Voltage],"cable","red cable","value",'Table 1'[Red cable]), SELECTCOLUMNS('Table 1',"equipment",'Table 1'[Equipment],"voltage",'Table 1'[Voltage],"cable","yellow cable","value",'Table 1'[yellow cable]), SELECTCOLUMNS('Table 1',"equipment",'Table 1'[Equipment],"voltage",'Table 1'[Voltage],"cable","blue cable","value",'Table 1'[blue cable]) )You will get a new table like below by using above methods.
Then you could create slicer and line chart as below.
Best Regards,
Jay
6 Replies
- amitchandak
Super User
abgnfirdaus , You need to create a measure slicer. or calculation groups
measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slicer-parameter-table-pattern
https://www.youtube.com/watch?v=vlnx7QUVYMEUsing calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/- abgnfirdaus
Helper I
Is there any other way without using external tools?
- amitchandak
Super User
abgnfirdaus , These are without external tools
measure slicer
https://www.youtube.com/watch?v=b9352Vxuj-M
https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...
https://radacad.com/change-the-column-or-measure-value-in-a-power-bi-visual-by-selection-of-the-slic...
https://www.youtube.com/watch?v=vlnx7QUVYME
- Ashish_Mathur
Super User
Hi,
In the Query Editor, select the first 2 columns, right click and click on "Unpivot Other columns". Now build your slicer/visual.
- AnonymousNot applicable
Hi abgnfirdaus ,
It is not supported to use column header as slicer and use DAX to get column header.
You could try following methods.
1# Open Query Editor, select these 3 columns and use Unpivot Columns feature.
2# Create a calculated table by using below formula:
Table 2 = UNION( SELECTCOLUMNS('Table 1',"equipment",'Table 1'[Equipment],"voltage",'Table 1'[Voltage],"cable","red cable","value",'Table 1'[Red cable]), SELECTCOLUMNS('Table 1',"equipment",'Table 1'[Equipment],"voltage",'Table 1'[Voltage],"cable","yellow cable","value",'Table 1'[yellow cable]), SELECTCOLUMNS('Table 1',"equipment",'Table 1'[Equipment],"voltage",'Table 1'[Voltage],"cable","blue cable","value",'Table 1'[blue cable]) )You will get a new table like below by using above methods.
Then you could create slicer and line chart as below.
Best Regards,
Jay