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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
ZHelbert2277
New Member

Formatting within a switch measure as a percentage on a bar chart

I have the below measure being used to allow a user to change the metric being displayed on a bar chart. I cannot get any type of conditional formatting to work on the index 1 and defaul values that allow them to be displayed as a percentage. How can I accomplish this? I tried wrapping this 

 

COUNT('Complete Results'[Recipient Email]) / CALCULATE (COUNT('Complete Results'[Recipient Email]),ALLSELECTED())*100

 

in Format(Value,"Percent") and some otehr things I found on the forums, but none of them seemed to work. 

 

Any help is appreciated.

 

According to this post it is not supported https://community.powerbi.com/t5/Desktop/Creating-a-dynamic-chart-with-formats-Number-and-Percentage...

 

Are there any workarounds or another way I can accomplish teh same results?

 

Selected Metric =
SWITCH(
            TRUE(),
SELECTEDVALUE( 'Metric Selector'[Index] ) = 1, COUNT('Complete Results'[Recipient Email]) / CALCULATE (COUNT('Complete Results'[Recipient Email]),ALLSELECTED())*100,
SELECTEDVALUE( 'Metric Selector'[Index] ) = 2, IFERROR((IFERROR([Low Proj],0) + IFERROR([High Proj],0))/2,0)*-1,
SELECTEDVALUE( 'Metric Selector'[Index] ) = 3, -1*CALCULATE(ROUND(SUM('Complete Results'[Company_Change_in_Revenue]),2)),
COUNT('Complete Results'[Recipient Email]) / CALCULATE (COUNT('Complete Results'[Recipient Email]),ALLSELECTED())*100)
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ZHelbert2277 , Create measure like this

COUNT('Complete Results'[Recipient Email]) / CALCULATE (COUNT('Complete Results'[Recipient Email]),ALLSELECTED())

 

From measure tool , option you will see once have measure selected in fields pane. You can mark it as % (There is a symbol)

 

refer here

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-measures#organizing-your-measures

 

Second, if you are using a measure slicer prefer field parameters or calculation groups

 

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...

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

@ZHelbert2277 , Create measure like this

COUNT('Complete Results'[Recipient Email]) / CALCULATE (COUNT('Complete Results'[Recipient Email]),ALLSELECTED())

 

From measure tool , option you will see once have measure selected in fields pane. You can mark it as % (There is a symbol)

 

refer here

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-measures#organizing-your-measures

 

Second, if you are using a measure slicer prefer field parameters or calculation groups

 

https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...

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

I will try this and see if it works, thank you!

Helpful resources

Announcements
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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

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