Forum Discussion

lg1551's avatar
lg1551
Icon for Resolver II rankResolver II
3 years ago
Solved

Dynamic Y-Axis on Clustered Bar Chart Based on Slicer Selection or No Selection

I have a clustered bar chart that uses a slicer at top of page to slice between three different Regions.

 

The scenario I want is this:

 

If no region is selected, the bar chart will display the Region level data (a bar for each Region).

 

If I select a Region in the slicer, the bar chart should display the Location level data (as many locations as there are under the Region selected) and not the Region level data. I don't want to have to drill-down here.

 

I've tried playing with paramters, hierarchies, and calculated columns and not getting the results I want.

 

Any ideas?

 

Both Region and Location come from the same table. But I'm unable to use a measure as a Y-Axis on the clustered bar chart to achieve this.

 

 

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi lg1551 ,

     

    You can try the field parameters to switch fields freely. 

    Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

    Add the region field and the location field to the left, clck "Create".

    Then the field parameter is created.

    Create visuals as follows, you can download the attachment for details. If both slicers are not selected or the parameter slicer selects "Region", the bar chat shows the regions only.

    If the parameter selects "Location" and another slicer selects regions, the bar chart shows locations.

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.           

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi lg1551 ,

     

    You can try the field parameters to switch fields freely. 

    Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn

    Add the region field and the location field to the left, clck "Create".

    Then the field parameter is created.

    Create visuals as follows, you can download the attachment for details. If both slicers are not selected or the parameter slicer selects "Region", the bar chat shows the regions only.

    If the parameter selects "Location" and another slicer selects regions, the bar chart shows locations.

                                                                                                                                                             

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.