Forum Discussion

powerbiexpert22's avatar
powerbiexpert22
Icon for Impactful Individual rankImpactful Individual
30 days ago
Solved

customize legends label

is there a way to customize legends label in below chart, i am using field parameters in the field of bar chart and it shows legends based on selected currency , example if user selects USD then it is showing legends in USD however i want to display without currency example , CY Actuals, PY Actuals and CY Plan etc

 

 

  • Hi powerbiexpert22​,

    If you just want to show "CY Actuals" without currency, you can simply edit your field parameter and edit parameter names like below:-

    CY Actuals = {
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals Loc]), 1),
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals USD]), 2),
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals EUR]), 3),
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals SGD]), 4)
    }

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    πŸ’‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    πŸŽ– As a proud SuperUserand Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
    πŸ”— Curious to explore more? [Discover here].
    Let’s keep building smarter solutions together!

4 Replies

  • Hi powerbiexpert22​,

    If you just want to show "CY Actuals" without currency, you can simply edit your field parameter and edit parameter names like below:-

    CY Actuals = {
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals Loc]), 1),
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals USD]), 2),
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals EUR]), 3),
        ("CY Actuals", NAMEOF('Measures Table'[CY Actuals SGD]), 4)
    }

    🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    πŸ’‘ Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    πŸŽ– As a proud SuperUserand Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
    πŸ”— Curious to explore more? [Discover here].
    Let’s keep building smarter solutions together!

  • Hi powerbiexpert22,

    If you need full control over the legend labels, I would not try to force it through the built-in legend. The native legend is still quite limited in terms of customization.

    A practical workaround is to switch the chart legend off and create your own legend using another object β€” for example, a small table/matrix, text boxes and/or shapes.

    This gives you complete control over the displayed text, so instead of CY Actuals USD / PY Actuals USD / CY Plan USD, you can simply show CY Actuals / PY Actuals / CY Plan, regardless of which currency measure is selected by the field parameter.

    The custom legend can also be made dynamic with DAX and conditional formatting if needed.

    I demonstrated the same general approach here:
    How to hide legend of a stacked column chart – custom legend example

    In that example I used a small table plus conditional formatting to generate the legend manually. The exact requirement is different, but the technique is the same.

     

     If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly