Power BI Exchange

Please login or click SIGN UP FOR FREE to create your PowerBIUG account to join this user group.
 View Only
  • 1.  How to change bar chart colors based on column head slicers

    Posted Apr 24, 2022 01:51 PM
    Hi, I am stuck with this

    i have  yes/no values in 4 columns. The slicer should be of the 4 column names  and when i select it , it should filter out and change the color of bars in bar chart

    ID Employee Position_Name IS_OUTGOING IS_FULLTIME IS_reemployed IS_INCOMING ESTAB TYPE
    1 Gabrielle Gardner Director Yes Yes No No MAIN
    2 Blossom Howard Manager No Yes Yes No MAIN
    3 Anayah Armstrong senior No Yes No No MAIN
    4 Fraser Kelly staff No No No Yes Non Main
    5 Marcel Parry intern No Yes No No MAIN



    i need the result to be like this.

    please i need help to solve this issue.

    ------------------------------
    sneha sai GMK
    560037
    ------------------------------


  • 2.  RE: How to change bar chart colors based on column head slicers

    Bronze Contributor
    Posted Apr 25, 2022 03:38 AM
    Unpivot the four yes/no columns first, then you will have the data in a usable format.

    ------------------------------
    James Watts
    Business Intelligence Analyst
    ------------------------------



  • 3.  RE: How to change bar chart colors based on column head slicers

    Gold Contributor
    Posted Apr 25, 2022 05:51 AM
      |   view attached

    Hi sneha sai GMK

    Will something like this work for you? If so then please see the attached pbix.



    ------------------------------
    Shungu Dhlamini
    Power BI Consultant
    shungud@gmail.com
    ------------------------------

    Attachment(s)



  • 4.  RE: How to change bar chart colors based on column head slicers

    Bronze Contributor
    Posted Apr 26, 2022 03:09 AM
    I think you might want to change the calculation to this, so that 'Incoming' and 'Outgoing' are specified, and anything else is orange.

    Bar Colour = SWITCH(MAX('Table'[Employee Status]),
    "Incoming","Green",
    "Outgoing","Red",
    "Orange"
    )


    ------------------------------
    James Watts
    Business Intelligence Analyst
    ------------------------------



  • 5.  RE: How to change bar chart colors based on column head slicers

    Posted Apr 29, 2022 01:38 AM
    Hi,

    it should be like if the employee is full time he should be shown as "Blue" and if he an outing employee he should be "RED". If the employee status is YES in both he should be drawn as outgoing employee i.e., red

    ------------------------------
    sneha sai GMK
    560037
    ------------------------------



  • 6.  RE: How to change bar chart colors based on column head slicers

    Bronze Contributor
    Posted May 02, 2022 05:35 AM
    I think your simplest solution is to create a calculated column, and use nested IF statements to define the colours:

    Bar Colours = IF(condition1 || condition2.... || condition_n, "Red",
       IF(condition1 || ....., "Amber", "Green")
       )
    || specifies OR, and && can be used for AND.

    ------------------------------
    James Watts
    Business Intelligence Analyst
    ------------------------------



  • 7.  RE: How to change bar chart colors based on column head slicers

    Posted Apr 29, 2022 01:40 AM
    Tq Shungu.. i have tried your solution but its not working out

    ------------------------------
    sneha sai GMK
    560037
    ------------------------------



  • 8.  RE: How to change bar chart colors based on column head slicers

    Gold Contributor
    Posted Apr 29, 2022 05:19 AM
    Perhaps attaching your version of pbix showing what worked and what didn't  can help us assist you further.

    ------------------------------
    Shungu Dhlamini
    Power BI Consultant
    shungud@gmail.com
    ------------------------------



  • 9.  RE: How to change bar chart colors based on column head slicers

    Posted May 24, 2022 07:07 AM
      |   view attached

    Hi,
    sorry for the late replies.

    please find the pbix file.

    the request has been changed.

    I want all the ids in stacked bar. seperate block for each id if senior director has 4 members... the stacked bar should contain 4 blocks and should change accordingly with outgoing, incoming etc....

    i have tried it  but  its not working..... please find attached pbix file.



    ------------------------------
    sneha sai GMK
    560037
    ------------------------------

    Attachment(s)

    pbix
    color bar.pbix   38 KB 1 version