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

Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.

Reply
RingoSun
Helper II
Helper II

Adding percent symbol to a dynamic measure

QtyOrPercent = 
VAR Selection = SELECTEDVALUE('View Options'[Options])
RETURN
SWITCH(
    TRUE(),
    Selection = "By Percentage", [QTY %],
    Selection = "By Quantity", [QTY]
)

 

I have this measure above and basically I am switching to either percentage or just the plain sum based on the selected option on the slicer. My issue is I want to add a percentage symbol if the percentage option is selected. Using the Formatting option isn't viable here as it would turn the plain Quantity value into a percentage as well. 

 

What are my options here? I tried doing something like below but it didn't work and my line graph became empty.

QtyOrPercent = 
VAR Selection = SELECTEDVALUE('View Options'[Options])
RETURN
SWITCH(
    TRUE(),
    Selection = "By Percentage", FORMAT([QTY %], "Percent"),
    Selection = "By Quantity", [QTY]
)
1 REPLY 1
amitchandak
Super User
Super User

@RingoSun , I think you should consider the field parameter for this release in May 2022, or the calculation group

 

Discussed both in Blog and video at the end of blog - https://medium.com/@amitchandak/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9a...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

May 2025 Monthly Update

Fabric Community Update - May 2025

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