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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
schanna
Frequent Visitor

Non Functioning Slicer Options : Dynamically Changing X-Axis of Vertical Bar chart

Hello Members,

 

Objective : To dynamically change metrics in the X-axis of vertical bar chart while keep y- axis constant.

 

Problem : Two metrics selected in the slicer are not rendering in the bar chart namely. That is viz not getting generated in bar chart:

                 (a) "CYTD vs PYTD %"

                    (b) "CYMTD vs PYMTD %"

 

Implementation: 

1) Table created with a field which contains names of different metrics to show in bar chart.

2) Measure created with switch function to tie the metric names with appropriate metric dax calculations is as under:

schanna_0-1668512204825.png

3) All the metrics listed above are absolute (in millions) expect for the two metric listed in problem which are relative (in percentage).

4) Dax Code for the issue metrics are as under (relative data type in percentage):

   (a) "CYTD vs PYTD %"  ---- IFERROR( ( [NIS CYTD]-[NIS PYTD] ) / abs( [NIS PYTD] ), 0 )

5) We tried making the two listed above problem metric data type into decimal but the problem persisit.

    (b) CYMTD vs PYMTD % ------  IFERROR( ( [NIS MTD]-[NIS PYMTD] )/abs[NIS PYMTD] ), )

 

Request members to provide support in solving this issue.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@schanna , Use field parameter release in May 2022, that is a better option

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
Field Parameters- Conditional Formatting
: https://amitchandak.medium.com/field-parameters-conditional-formatting-517aacc23fdf

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

1 REPLY 1
amitchandak
Super User
Super User

@schanna , Use field parameter release in May 2022, that is a better option

 

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE
Switch TOPN with Field Parameters: https://amitchandak.medium.com/switch-topn-with-field-parameters-299a0ae3725f
Field Parameters- Conditional Formatting
: https://amitchandak.medium.com/field-parameters-conditional-formatting-517aacc23fdf

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

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.