Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

How to make X axis dynamic for bar graph

I have a table in Power BI that looks like this -

 

IDFRUITCOLORTASTEVALUE
1AppleRedSweet10
2AppleGreenSour5
3OrangeOrangeSweet20
4GrapeVioletSweet10
5BananaYellowSweet5
6GrapeGreenSweet20

 

Like Fruits, Color and Taste, I have close to 50 columns, and I want to create a bar chart that dynamically changes X axis (on click of the column name as per user choice) and plots the sum of price as Y value. I tried to achieve this by creating a second table that has all the column names and its attribute combination (like a helper table with 2 columns), but the view created by that method is not working with the slicers present. (e.g. bar chart for X axis= Fruit, filtered for color = Red).

Is there a way to get this done?

 

TIA.

1 Reply

  • Read about the Field Parameters option that was introduced in May 2022.