Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Switch fields that are shown in chart based on slicer selection

Hello everyone,

 

I've got some data that looks like the following. 

GroupA_1A_2A_3B_1B_2
A10000
A01100
A01100
A01100
A10000
A01000
B00011
B00001
B00010
B00010
B00010

I'd like to have a chart and a slicer, whereby if the user selects Group A in the slicer, sum of columns A_1, A_2 and A_3 are shown in the chart. Likewise, if the user selects Group B from the slicer, sum of columns B_1 and B_2 are shown in the chart. The screenshots below illustrate the result I'd like to achieve.

                            

Is this possible?

Thank you for any suggestions!

 

 

  • Hi,

    In the Query Editor, right click on the first column and select "Unpivot other columns".  Now create your chart.

6 Replies

  • Hi,

    In the Query Editor, right click on the first column and select "Unpivot other columns".  Now create your chart.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi v-easonf-msft: In your screenshot above, A_1, A_2 and A_3 are still showing in the legend of the chart when you select Group B in the slicer. Is there a way to show only B_1 and B_2 when Group B is selected and show only A_1, A_2 and A_3 when Group A is selected?

      • v-easonf-msft's avatar
        v-easonf-msft
        Icon for Community Support rankCommunity Support

        Hi,  Anonymous 

        Currently Power BI cannot control the content displayed in the pie chart legend.

        You can also consider creating a three-page report and replacing slicers with bookmarks.

         

        Best Regards,
        Community Support Team _ Eason