Forum Discussion

crenninger's avatar
crenninger
Regular Visitor
6 years ago
Solved

Bar chart / Stacked bar chart / pie chart color based on database field?

Hi all, 

 

I would like to control the bar and pie chart colors based on a attribute in my dimension tables.

I created "color" field in the dimension for my categories and now I want to use the color value from the database to be used in my chart.

I've looked at the condition formating but it's not allowing me to achieve what I am trying to.

 

in the "Data colors" I want to provide the color for each category from a field in the database.

 

I have many report and many charts in the reports using the same categories and I want to control the colors for each category across all reports/pages/graphs.

 

Any advice on how to achieve this would be great.  Maybe I am missing something obvious here.

thank you!

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi crenninger 

    I have a test and I found the result like yours:

    We can't use fx in stack visual if we add legend , and we can't use fx in donut and pie visual.

    You may vote up an idea for this function: Condition formatting for measure

    Best Regards,

    Rico Zhou

     

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

     

8 Replies

  • lkalawski's avatar
    lkalawski
    Icon for Resident Rockstar rankResident Rockstar

    Hi crenninger 

    Please send sample data or file. It will be easier to help you solve the problem.

     

    Generally speaking, your thinking is good. Ideally, you would create a measure that checks what category is currently selected and automatically assigns a color from the column that lists the colors.



    _______________
    If I helped, please accept the solution and give kudos! 😀

    • crenninger's avatar
      crenninger
      Regular Visitor

      This is not exactly what I am trying to do, remember I am looking for Bar char, Stacked Bar chart and Pie chart.

       

      Based on a simple table in PBI  see screen shot on what I am trying to do.

       

      I can't find how to attach a PBIx file to this post unfortunately

      Here is the table

       

       

      I hope this helps explain.

      • crenninger's avatar
        crenninger
        Regular Visitor

        Anyone had an idea or is this just not possible?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi crenninger 

    Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. And please vote up the function you want in Idea.

     

    Best Regards,

    Rico Zhou