Forum Discussion

abgnfirdaus's avatar
abgnfirdaus
Icon for Helper I rankHelper I
4 years ago
Solved

multiple column in one slicer

Hello there, I have a question. Let say the table is:

EquipmentVoltageRed cableBlue cableYellow cable
TRU 16.6kV0.230.450.65
TRU 26.6kV0.320.50.7
TRU 36.6kV0.40.560.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.
  • Anonymous's avatar
    Anonymous
    4 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