Forum Discussion

ngct1112's avatar
ngct1112
Icon for Post Patron rankPost Patron
4 years ago

How to pivot a table into slicer

Hi All,

 

I would like to create a slicer with this date set.

ItemProblem AProblem BProblem C
1FailFailFail
2PassFailPass
3FailPassFail
4PassPassFail
5FailFailPass

 

I am hoping to build a slicer to see which items are under Problem A or B or C.

 

For example,

when I select "Problem A' in the slicer, it could filter the failed items: 1,3,5 

when I select "Problem B' in the slicer, it could filter the failed items: 1,2,5

when I select "Problem C' in the slicer, it could filter the failed items: 1,3,4

 

Appreciated if you have any idea.

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    ngct1112 In Power Query Editor, select your three problem columns and then right-click and unpivot.

    • ngct1112's avatar
      ngct1112
      Icon for Post Patron rankPost Patron

      Greg_Deckler , since my "ProblemA,B,C" columns are built by add column.
      Do you have any idea to make it workable by measure?

      Thanks

  • ngct1112 , Create a measure like

     

    Countrows(Filter(Table, Switch(True() ,

    selectedvalues(Slicer[Sclier]) ="Problem A", Table[Problem A] = false() ,

    selectedvalues(Slicer[Sclier]) ="Problem B", Table[Problem B] = false() ,

    selectedvalues(Slicer[Sclier]) ="Problem C", Table[Problem C] = false()

    ))

    • ngct1112's avatar
      ngct1112
      Icon for Post Patron rankPost Patron

      amitchandak thanks for that, but it seems not working since I just have the dataset which those "Problems" are in different columns. And I could not selectvalue because they are not yet in a slicer.