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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

How to change the format on the Y-axis (% vs value) on a bar graph at run time?

Hi All,

 

How to change the format on the Y-axis (% vs value) on a bar graph at run time?

 

I have two tables [ Data Table, Filter Table]. I am creating a bar graph with X-axis as Name and Y-axis as Output. "Output" is the measure which is changing between Sum_KPI and PCT_KPI as per the filter selection from Filter table. the formula for Output function is mentioned below:

 

Ouput = SWITCH(
                             SELECTEDVALUE(Filter_Table[Filter]),
                             "Sum", [Sum_KPI],
                             "Percentage", [PCT_KPI]
)

 

Value on Y-axis is getting change as per the selections from filter however formate is not getting change from value to the percentage or vice versa.

 

Kindly refer attached PBIX file for more detail.

 

Kindly suggest how to change the format on the Y-Axis at run time.

 

Thank you.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @Anonymous ,

 

I'm afraid this may can't be achieved in Power BI. The format of one measure can't be changed dynamically between Number and Percentage.

 

One workaround, for example:

1. Insert Blank buttons.

button.jpg

2. Fill the button text with "Sum" and "Percentage".

button.PNG

 

3. After create all visuals, Duplicate this report page ("Sum").

duplicate.PNG

 

4. Replace [Sum_KPI] with [PCT_KPI] in visuals.

 

5. Set Action of "Percentage" button on "Sum" page.

pa.PNG

 

6. Set Action of "Sum" button on "Percentage" page.

sa.PNG

 

7. Hide page "Duplicate of Sum".

 

8. Test.

percentage.gif

 

BTW, .pbix file attached.

 

 

Best Regards,

Icey

 

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

View solution in original post

3 REPLIES 3
Icey
Community Support
Community Support

Hi @Anonymous ,

 

I'm afraid this may can't be achieved in Power BI. The format of one measure can't be changed dynamically between Number and Percentage.

 

One workaround, for example:

1. Insert Blank buttons.

button.jpg

2. Fill the button text with "Sum" and "Percentage".

button.PNG

 

3. After create all visuals, Duplicate this report page ("Sum").

duplicate.PNG

 

4. Replace [Sum_KPI] with [PCT_KPI] in visuals.

 

5. Set Action of "Percentage" button on "Sum" page.

pa.PNG

 

6. Set Action of "Sum" button on "Percentage" page.

sa.PNG

 

7. Hide page "Duplicate of Sum".

 

8. Test.

percentage.gif

 

BTW, .pbix file attached.

 

 

Best Regards,

Icey

 

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

Anonymous
Not applicable

Not able to upload the PBIX file

 

 

Sample data would greatly help, most people share their PBIX using OneDrive, Box or other file sharing service.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors