How can we improve Power BI?

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.

2,123 votes
Sign in
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Matt Allington shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

From the comments and scenarios everyone’s describing, the problem is really that you need a way to allow end-users to change which measure is displayed in a visual on the fly.

As a few folks have mentioned, the FORMAT function might help in the interim, as long as you’re showing the results in text rather than a chart. has details on how to use that.

The expression-based formatting feature that we’ve started work on may help to a certain extent, but that’s really designed to change a visual’s properties rather than the data type or format. We’ll look into extending that work to support this scenario as well.

We’re moving this to Backlog status – our core plan is to build ways that end-users can change the dimensions or measures that are visible in a chart on the fly. They’ll be able to explore much more freely rather than relying on the author to have set up complex expressions to control what’s available. We’ll update with more details as they’re available.


Sign in
Sign in with: facebook google
Signed in as (Sign out)
  • Lotta commented  ·   ·  Flag as inappropriate

    Preferably also working from Tabular cube measures and formatting.
    This is currently a huge disadvantage.

  • Mark Stacey commented  ·   ·  Flag as inappropriate

    Any news on this? It's a real pain point.

    The alternative to this would be a measure picker in the power BI front end - then we could have a measure we could choose from (the latter is my preferred solution)

  • Anonymous commented  ·   ·  Flag as inappropriate

    It's strange that this is almost at 2K votes and hasn't even received any sort of response from Microsoft. There are quite a few ideas with less votes that have received responses...but not this one.

  • Anonymous commented  ·   ·  Flag as inappropriate

    Does anyone know if this will be possible with the upcoming Expression-Based Formatting feature?
    This is the description:
    "Report authors need flexibility over how their visuals are formatted. As well as defining formatting through the formatting pane, a DAX expression can be used to set the formatting, giving full control over the business logic used to format the visual.

    Authors can create rules that set the color of a KPI based on the progress towards a goal, set the style of a line on a chart based on which category is performing best, or any combination of these. Authors can even dynamically update the title of a visual based on selections made elsewhere in the report."

  • Stelvio Gori commented  ·   ·  Flag as inappropriate

    Well, you can achieve that using FORMAT in your measure definition, e.g. (real example, nth member of a SWITCH clause):
    values('KPI'[KPI]) = "VA/Ricavi"; format(divide(CALCULATE ( [Importo]; tb_CE[IdTopParent] = 1) +
    CALCULATE ( [Importo]; tb_CE[IdTopParent] = 7);CALCULATE ( [Importo]; tb_CE[IdTopParent] = 1));"0.00%")

  • Andreas S. commented  ·   ·  Flag as inappropriate

    come on - more than 1000 votes and no "we consider that on our roadmap" comment or something similar from the MS team???

  • Anonymous commented  ·   ·  Flag as inappropriate

    It would be very helpful to support business needs to show both number and ratio format.

  • victor commented  ·   ·  Flag as inappropriate

    That would be so useful and would make the reports faster! I am working in a financial reports, and I was obligated to create an "Amount measure" and an "% measure" since i can not create just one u.u

  • Alexis Olson commented  ·   ·  Flag as inappropriate

    The FORMAT function sort of works, but means the result is text data type and values are rounded to precision displayed.

  • attila commented  ·   ·  Flag as inappropriate

    @Patrick, "FORMAT" function works for tables and Matrix, unfortunately STILL not working for e.g. stacked charts..Is there a reason we still have no answer from the team after 2 years?

  • Daniel commented  ·   ·  Flag as inappropriate

    This would be extremely helpful, please try and get this one out please.

  • Subin commented  ·   ·  Flag as inappropriate

    This has been in request since two years and it is a very basic requirement as we do not have a global variable option too in Power BI. Looking forward to the team to include this flexibility.

  • David Cresp commented  ·   ·  Flag as inappropriate

    This one should be simple and would add so much value to every dashboard that I do. Please MS bring this one in to PBI.

  • Anonymous commented  ·   ·  Flag as inappropriate

    I can't believe that this idea has not been implemented. The inability to conditionally format values with the SWITCH function is a severe limitation on what would otherwise be a very elegant and useful reporting function.

← Previous 1 3

Feedback and Knowledge Base

Ready to get started?

Try new features of Power BI today by signing up and learn more about our powerful suite of apps.