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
uarora
New Member

Formatting issue when using switch for number and percentage measures together

Hello,

 

I am creating a Power BI report in which there are multiple measures being switched using a slicer. Screenshot below:

uarora_1-1726048026231.png

 

The issue that I am facing is with the formatting of numbers and percentage metrics. The numeric measures work fine but the percentages get displayed as a decimal. Screenshots below:

uarora_2-1726048222674.pnguarora_3-1726048248764.png

Below is the dax for the measure that allows to switch between all the measures:

 

CYVal = SWITCH(TRUE(),  

    [SelectMetric] = "Clinic Revenues", [Production],
    [SelectMetric] = "Total Marketing Spend", [Expense (CY)],
    [SelectMetric] = "Marketing Spend as % of Revenue", [Marketing spend as % Revenues (CY)],
    [SelectMetric] = "Total New Patients", [Total New Patients],
    [SelectMetric] = "Cost per Total New Patients", [Cost Per Total New Patient (CY)],
    [SelectMetric] = "New Patients", [New Patients],
    [SelectMetric] = "Cost Per New Patient", [Cost Per New Patient],
    [SelectMetric] = "Referral Source Marketing %", [Ref Source Mkt %],
    [SelectMetric] = "New Patients from Marketing", [New Patients Mkt],
    [SelectMetric] = "Cost per New patients from Marketing", [Cost Per Total New Patient Mkt (CY)],
    [SelectMetric] = "Active Patients", [Active Patients],
    [SelectMetric] = "Returned Patients as % of New", [Returned Patients as % of New],
    [SelectMetric] = "Total New Patients X 12 as % of Active Patients", [Total New Patients Annual % of Active],
    [SelectMetric] = "Lost Patients X 12 as % of Active Patients", [Lost Patients Annual % of Active]
)

 

 
The format of the CYVal measure is set to General. Formatting of the internal measures differs like for New Patients it is whole number whereas for Ref Source Mkt % it is set to Percentage.
 
The DAX format function will not work here since that returns a text output and we need numbers to get the columns. Please assist if anyone can. Thanks.
1 REPLY 1
vikramkumawat
Advocate II
Advocate II

Hi @uarora ,
you can use dynamic formating for the CYVal as like the given documentation https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings
also another option is : You can use multiple measures using fields parameters if you want to switch among them like:https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.