Forum Discussion

Snagalapur's avatar
Snagalapur
Helper IV
1 year ago
Solved

Conditionally colour format bar chart

Hi All,

Please suggest how to conditionally colour format Bar chart, currently bar chart toggle between 3 options/measures using slicer (field parameter) Ex: -ve values in red/ #FF0000 and +ve values in Green/#00CC66

 

Measures:
Act v. Bud (Top 10 Bar chart) =  SUM('Table'[actual])- SUM('Table'[budget])

Field paramater: 

KPI's = {
     ("Act v. Bud", NAMEOF('MEASURES_TABLE'[Act v. Bud (Top 10 Bar chart)]), 0),
    ("Act v. Fcst", NAMEOF('MEASURES_TABLE'[Act v. Fcst (Top 10 Bar chart)]), 1),
    ("Act v. LY", NAMEOF('MEASURES_TABLE'[Act v. LY (Top 10 Bar chart)]), 2)
   }
 

Thank you.

  • If you replaced the field parameter with a calculation group, you could add a measure for conditional formatting that leverages selectedmeasure()

     

    Switch(

    True,

    selectedmeasure() < 0, "#FF0000",

    Selectedmeasure() >= 0, "#00CC66"

    )

4 Replies

  • Deku's avatar
    Deku
    Super User

    If you replaced the field parameter with a calculation group, you could add a measure for conditional formatting that leverages selectedmeasure()

     

    Switch(

    True,

    selectedmeasure() < 0, "#FF0000",

    Selectedmeasure() >= 0, "#00CC66"

    )

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Snagalapur ,
    I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Snagalapur ,
    I just wanted to kindly follow up to see if you had a chance to review the previous response provided by community members. I hope it was helpful. If yes, please Accept the answer so that it will be helpful to others to find it quickly.
    Thank you.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Snagalapur ,
    We haven't heard back from you regarding our last response and wanted to check if your issue has been resolved.
    If our response addressed your query, please mark it as Accept Answer and click Yes if you found it helpful.
    If you have any further questions, feel free to reach out.
    Thank you for being a part of the Microsoft Fabric Community Forum!