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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Conditional formatted measures using SWITCH

A current limitation in Power BI SWITCH measures (and all Power Pivot actually) is that a SWITCH measure must have a single format. It is currently not possible to conditionally format the measure result based on any criteria - it is one single format only. There are valid use cases where you may want to change the format of the SWITCH measure depending on the result. Consider the following SWITCH statement myMeasure = SUMX(MeasureTable,switch([selected measure], 1,[Total Sales], 2,[Total Cost], 3,[Total Margin], 4,[Chg Sales vs LY %] )) The first 3 results are all currency format, but the last result is a percentage format. This currently can't be controlled. I would like to see an optional 3rd parameter in the SWITCH statement to set an alternate number format.
Status: Declined
Comments
lotta_carlsson8
New Member
It is a nice thought that end-users can change the dimensions or measures that are visible in a chart on the fly. But on fly is limited if it's not also applied to row formatting as described in this idea. This is a huge limitation that will point end-users in a direction towards other tools that will have this abillity.
robert_slattery
New Member
My view is that this would be solved if the FORMAT function had Left, Center and Right alignment and padding. Maybe this would be simpler?
JohnThomas1
New Member
myMeasure = SUMX(MeasureTable,switch([selected measure], 1,{[Total Sales], type currency}, 2,{[Total Cost], type currency}, 3,{[Total Margin], Percentage.Type}, 4,{[Chg Sales vs LY %], Percentage.Type} ))
alexandre_vacqu
New Member
needed thanks
wade_mcgriff
New Member
In Excel, you can change the format of a y-axis on a graph or the values of a pivot table value independently of the underlying source data. So similarly to being able to adjust the Display Units and decimal places of the labels and/or axis of a given visual you should also be able to edit the format independent of the underlying measure or column. Further to address this idea, you could allow expressions on this similar to titles which would solve the problem that we are having. This would allow the underlying measure or column to remain as a number as opposed to text and therefore it would be "graphable" and then the graph or visual axis/label formatting could handle how it is displayed in terms of the format. Update: looks like they are solving this with calculation groups, but i still like the idea above which would be an agile option for end users.
amorgan2
New Member
Please implement this idea. Would make our financial reporting much easier.
hdegroot2
New Member
We need this feature in financial reports! Users have to be able to switch to actual values and values in thousands.
rafal_kun
New Member
Hi - this can now be done although it is a bit complex and has some limits. Check my post here: https://community.powerbi.com/t5/Desktop/Dynamic-formatting-of-measures-tutorial/m-p/1297373#M565099
sohail4
New Member
One of the great Idea
dabu1
New Member
Hi, this is excellent idea. Must have for PowerBI. br, Dainius B.