web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Pie Chart Items color ...
Power Apps
Answered

Pie Chart Items color set is not working

(0) ShareShare
ReportReport
Posted on by 522

I am trying to change the color based on the status column, when I change the status the color shows the same as first color.

 

ForAll(
 data source,
 Switch(
 Status,
 "At Risk",Yellow,"On Track",Green,"Not Yet Started",Gray,"Complete",DarkBlue,"Not On Track",Red))

 

I have 6 items in the gallery when I change the item from "Not Yet Started" to "On Track". "Not Yet Started" in Pie Chart shows the Red color instead of Gray and another status "Not on Track" to Green. I am not sure what is wrong with the color set  

Categories:
I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Nikhil2 ,

     

    Can you try the code below ?

     

    ForAll(
     data source,
     {
     Value: Switch(
     Status,
     "At Risk",Yellow,"On Track",Green,"Not Yet Started",Gray,"Complete",DarkBlue,"Not On Track",Red)
     }
    )
  • Nikhil2 Profile Picture
    522 on at

    @WiZey I tried the above code but as I have explained in the main question it showing like this. On Track should be Green but it is showing gray as gray should be Not yet started

     

    Nikhil2_0-1662730307882.png

     

  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @Nikhil2 ,

     

    I'm experimenting on my side to try and replicate your case.

     

    For now, could you tell me if changing "On Track"'s color has any impact on the graph? Changing "Not Yet Started" has any impact too? Is there perhaps a hidden space character in the "On Track" of your datasource? Is the datasource in the formulae the same as the one your provided the graph?

  • Nikhil2 Profile Picture
    522 on at

    @WiZey Yes there is a impact on changing the On Track color and Not Yet Started Color. Yes, formulae and graph are same.

  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    Unless I intentionally gives different datasource, I can't seem to replicate your issue. I'm kind of running out of ideas, sorry.

     

    According to many other topics, the formulae seems to be correct. The issue may be on the Power Apps side.

     

    My last suggestions are deleting the pie chart and recreating it from scratch. I sometimes notice some internal failures with my components and simply deleting and re-creating them seems to fix it.

  • Nikhil2 Profile Picture
    522 on at

    I guess it could be powerapp issue, deleting the pie chart and adding it back solved the issue.

  • Nikhil2 Profile Picture
    522 on at

    Just updated the formulae as well. 

     

    ForAll(AddColumns(GroupBy(data source,"Status","LabelRisk"),"Count12", CountRows(LabelRisk)),
     Switch(
     Status,
     "At Risk", Yellow,
     "Complete", DarkBlue,
     "On Track", Green,
     "Not On Track",Red,
     "Not Yet Started",Gray
     )
    )

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 392

#2
WarrenBelz Profile Picture

WarrenBelz 364 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 271 Super User 2026 Season 1

Last 30 days Overall leaderboard