The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I am creating a Power BI report in which there are multiple measures being switched using a slicer. Screenshot below:
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:
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]
)
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