cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PrasadAthalye
Super User
Super User

Compare Choice column within Collection

This question is related to PowerApps for Teams.

 

I have a Table that has a Choice column with values as Yes, No, Not selected.

 

I am using group by to group on this column. Now the question is, how to filter from the group by group based on this column? I am using this expression within ItemColorSet of Pie chart.

 

In following code, If condition fails to compare and I see all the colors as Red.

 

ForAll(GroupBy(
Filter(
'Interviewer Recommendation Forms',
'Candidate Name' = Gallery4.Selected.Title1.Text
),
"cr01b_recommend",
"DataCount"
),
If("cr01b_recommend" = "Yes", Color.Green,Color.Red))

 

  • I tried Text("cr01b_recommend"), but no success.
  • I tried to look for Choice enum, but I did not find.

Is it a bug?

 

@ScottShearer @RezaDorrani @Pstork1 @StalinPonnusamy 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @PrasadAthalye ,

I have only addressed your question in the below, but this should work

ForAll(
   GroupBy(
      AddColumns(
         Filter(
            'Interviewer Recommendation Forms',
            'Candidate Name' = Gallery4.Selected.Title1.Text
         ),
         "Recommend",
         cr01b_recommend.Value
      ),
      "Recommend",
      "DataCount"
   ),
   If(
      Recommend = "Yes", 
      Color.Green,
      Color.Red
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz - Appreciate your help.

 

I tried above expression and it generated multiple errors. Filter condition does not seems to be correct to me. Following condition seems to be outside Filter function. Also Group by is giving error too.

 

'Candidate Name' = Gallery4.Selected.Title1

 

PrasadAthalye_0-1641820800089.png

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Hi @PrasadAthalye ,

The problem with free-typing code - had it round the wrong way - see amended post.

Thanks for the guidance. I changed it like below.. Had to tweak it.

 

ForAll(
   GroupBy(
      AddColumns(
         Filter(
            'Interviewer Recommendation Forms',
            'Candidate Name' = Gallery4.Selected.Title1.Text
         ),
         "RecommendCandidate",
         cr01b_recommend
      ),
      "RecommendCandidate",
      "DataCount"
   ),
   If(
      Text(RecommendCandidate) = "Yes", 
      Color.Green,
      Color.Red
   )
)
Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,964)