Forum Discussion

red_ltxj's avatar
red_ltxj
Frequent Visitor
1 year ago
Solved

Creating a Column Chart Affected by Multiple Slicers

Hi team,

I've been practicing PowerBI, and am trying to replicate the function on the 'Compare' page of this dashboard where you're able to select any two countries to be shown on the same column chart using two separate slicers.

I can't seem to make it work on my own. I have three slicers which interact with a column chart (but not with each other) which has the Cost of Living index on the Y axis split by country (on the X axis). The moment I select three different countries on the three slicers, the column chart disappears, but this doesn't happen when I have the same country selected on the slicers, and the column chart shows only a single column for the country selected on both the slicers.

If its of any help, I have measures calculated that average the Cost of Living Index across countries (and for all other indexes) and use it for the Y axis on the column chart.

I can't seem to attach the pbix. and the .csv source file, so I've attached a screenshot of the dashboard page I'd like to accomplish this on below. I'd like the slicers labelled with 'Country' to interact with the charts. Any help is appreciated, thanks!

 

5 Replies

    • red_ltxj's avatar
      red_ltxj
      Frequent Visitor

      Hi Barritown, 

      Thanks for the reply, and that worked. However, I've come across a problem. When I try to copy and paste the chart to create charts for different indexes (in this case Groceries Index), the charts come up as blank. In fact any chart that is added to the page will come up as blank. But, In the pbix. you attached, the charts copy and paste just fine. 

      Also, may I know how you created the 'countriesTbl' table and the 'Country' column in the example you sent? I did it by first creating a Field Parameter and then using the DISTINCT function you used to create the 'Country' column in that table, so I wanted to confirm if this was the correct way. 

      Thanks!

      • red_ltxj's avatar
        red_ltxj
        Frequent Visitor

        Hi Barritown, 

        Just following up, I've managed to figure out why the charts were not appearning (fixed it by editing the interactions of the slicers). 

        However, I noticed that the newly created and separate 'Country' tables aren't affected by slicers. May I know why this is? Thanks! 

  • barritown's avatar
    barritown
    Solution Sage

    Hi red_ltxj,

    The separate table is not connected with the main one, and the slicers that are based on the columns of the main table cannot affect the standalone table.

    Should you want to achieve such a behaviour, you can either create a filtering measure and apply to the slicer based on the separate table (in the filter pane) or do a bit of modelling and create an additional table for each column that is supposed to affect the selection, connect each of them with the main table and standalone one. 

    Please check the attached files.

    Best Regards,

    Alexander

    My YouTube vlog in English

    My YouTube vlog in Russian

    • red_ltxj's avatar
      red_ltxj
      Frequent Visitor

      That worked, thank you so much for your effort on helping me out. 🙂