Forum Discussion
abgnfirdaus
Helper I
4 years agomultiple 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....
- 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
Ashish_Mathur
Super User
4 years agoHi,
In the Query Editor, select the first 2 columns, right click and click on "Unpivot Other columns". Now build your slicer/visual.