Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PBI-Newbie
Frequent Visitor

Changing y axis in bar chart and pie chart dimension based on parameter in table visual

I have three different visuals on my page (table, bar chart and pie chart) and would like the dimensions on visual 2 & 3 (bar & pie chart) to change dynamically according to the slicer that determines visual 1 (table).

 

I have created a field parameter that contains Country, Department and Cost Type columns from 3 separate tables. This parameter drives the rows in visual 1 - the table. 


If Country is selected on the slicer (Dimension parameter) then I want visual 2 to show Department on the y axis and cost type in visual 3. 

I've created measures (drivers) that show the selected value for visual 1 and determine what dimension should be used for visual 2 and 3 ( switch function).
Now I am stuck. How do I get the dimension to switch on the axis? I can't put in a measure. Can I create a new parameter that uses the driver measures ?

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @PBI-Newbie 

You have a couple of options:

  1. Create a total of three field parameter tables for each of the "dynamic dimensions", i.e. the Dimension Parameter and two others. Then create relationships between these tables them so that the Dimension field parameter selection filters the other two.
    See here or here for some illustrations of how field parameter tables can be related.
  2. Extended the Dimension field parameter table by adding additional "field columns" (columns that are created using the NAMEOF function by default), and set the properties of these columns in Tabular Editor so that they are recognised as field parameter columns (see here for example).
    Similar to the example described in this Reddit post.
    This requires use of a tool like Tabular Editor to set the properties of the columns.

I would probably go with Option 1 for simplicity of setup. You just need to ensure that there is an appropriate column in each table for the relationship. Columns can be added by modifying the field parameter table expressions or by adding calculated columns.

 

Are you able to get this working?

Please post back if needed, and if you have a shareable PBIX representing your model that would help.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

3 REPLIES 3
v-zhangtin-msft
Community Support
Community Support

Hi, @PBI-Newbie 

 

Have you solved your problem yet? If not, can you provide example files and what output you expect?

How to provide sample data in the Power BI Forum - Microsoft Fabric Community

 

Best Regards,

Community Support Team _Charlotte

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

OwenAuger
Super User
Super User

Hi @PBI-Newbie 

You have a couple of options:

  1. Create a total of three field parameter tables for each of the "dynamic dimensions", i.e. the Dimension Parameter and two others. Then create relationships between these tables them so that the Dimension field parameter selection filters the other two.
    See here or here for some illustrations of how field parameter tables can be related.
  2. Extended the Dimension field parameter table by adding additional "field columns" (columns that are created using the NAMEOF function by default), and set the properties of these columns in Tabular Editor so that they are recognised as field parameter columns (see here for example).
    Similar to the example described in this Reddit post.
    This requires use of a tool like Tabular Editor to set the properties of the columns.

I would probably go with Option 1 for simplicity of setup. You just need to ensure that there is an appropriate column in each table for the relationship. Columns can be added by modifying the field parameter table expressions or by adding calculated columns.

 

Are you able to get this working?

Please post back if needed, and if you have a shareable PBIX representing your model that would help.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Thanks so much! The 3 parameter solution with relationship solution works like a charm!

Helpful resources

Announcements