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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to create a dynamic y-axis on a barchart using field parameters

I have the following problem: 

 

I want to use a barchart to visualize the percentage of defect parts which a production-line did produce within one day. It looks like this:

 

Unbenannt.PNG

 

So currently, I have 2 lines and their percentage amount of defect parts on every date in a table which looks like that:

 

DateM150_146600_defect_percentageM160_146600_defect_percentage
2024-04-180.00.01
2024-04-170.020.005
2024-04-160.0030.008
.........

 

What i want to do, is making the displayed production line "dynamic" which means, i want the user to select which line is shown on the Y-Axis. When the slicer is selected for the line, it should look like that:

 

Unbenannt.PNG

 

So basically, i want the columns to be shown in the bar-chart to be dependend on a slicer and let the user dynamically choose them. 

 

To achieve this, i thought about just using a field-parameter on that, the problem is, the percentage values which need to be plottet are columns, not messaures, so that is not possible. 

 

I deeply researched on the Internet for a way to achieve this, but i was not able to find a solution / workaround. 

 

So if anyone here has had a similar problem before and knows a solution / workaround, I would be realy greatful!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , if line using a secondary y-axis, you can use field parameters

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9afd
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE

 

If want to switch measure based on axis Field parameter

Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

 

You can also consider traditional measure slicer 

 

How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , if line using a secondary y-axis, you can use field parameters

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9afd
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE

 

If want to switch measure based on axis Field parameter

Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f

 

You can also consider traditional measure slicer 

 

How to create a Measure Slicer: https://youtu.be/b9352Vxuj-M

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hello amitchandak,

 

Thanks for sharing this.

 

I used the field parameter to create a measure slicer. I have a matrix visual.

 

However, when I put the parameter into the Values field of the Matrix, no matter what I select in the slicer, nothing in the table shows up. But if I put it in the row or column field, it functions well. Do you have any experience with that and do you know why?

Thank you so much,

Jason

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.