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 / Gettting the colour ch...
Power Apps
Unanswered

Gettting the colour changed on condition - formula issue?

(0) ShareShare
ReportReport
Posted on by 115

Hi Guys, I have the below formula in the text property of the label within a Gallery which Items are going from a collection called colERAll and it returns the correct count, however, I thought that if I use the same for the colour property using If(), like so;

 

Text: CountIf(colERActionsAll, Value(EducationReviewID) = ThisItem.ID && OpenAction = "1")

Color: If(colERActionsAll, Value(EducationReviewID) = ThisItem.ID && OpenAction = "1" && DueDate = <  Today(), Red, Black)

 

This would work, but I get errors, even just trying this in the color property: If(colERActionsAll, Value(EducationReviewID) = ThisItem.ID && OpenAction = "1", Red, Black), it says expecting boolean value. I also cannot seem to get the correct field, like DueDate to function within the color formula. 

 

I guess I need a revised If statement, as I would need to also to get the data from colERActionsAll, using the EducationReviewID as the reference. 

 

Text: CountIf(colERActionsAll, Value(EducationReviewID) = ThisItem.ID && OpenAction = "1")

Categories:
  • Aapok Profile Picture
    on at

    Without knowing how you populate your gallery I can't really provide you a solution. Would you mind posting a screenshot of the Items property of your gallery?

     

    You're getting the error because the first parameter in your If statement is a collection, instead of a boolean evaluation. 

  • iKettle Profile Picture
    115 on at

    Sure, here is the Items Property of the gallery - If(
    IsBlank(cbERYear_2.Selected.Result),
    If(
    IsBlank(cbERQtr_2.Selected.Result),
    If(
    IsBlank(cbERProcess_2.Selected.Result),
    If(
    IsBlank(cbERStatus_2.Selected.Result),
    colERAll,
    Filter(
    colERAll,
    ReviewStatus.Value = cbERStatus_2.Selected.Result
    )
    ),
    Filter(
    If(
    IsBlank(cbERStatus_2.Selected.Result),
    colERAll,
    Filter(
    colERAll,
    ReviewStatus.Value = cbERStatus_2.Selected.Result
    )
    ),
    cbERProcess_2.Selected.Result = Process.Value
    )
    ),
    Filter(
    If(
    IsBlank(cbERStatus_2.Selected.Result),
    colERAll,
    Filter(
    colERAll,
    ReviewStatus.Value = cbERStatus_2.Selected.Result
    )
    ),
    cbERQtr_2.Selected.Result = 'Planned Quarter'.Value
    )
    ),
    Filter(
    If(
    IsBlank(cbERStatus_2.Selected.Result),
    colERAll,
    Filter(
    colERAll,
    ReviewStatus.Value = cbERStatus_2.Selected.Result
    )
    ),
    Year.Value = cbERYear_2.Selected.Result
    )
    )

  • Aapok Profile Picture
    on at

    Would you mind going back to the Items property, press the Format Text button, then paste the code again inside a code sample block (</> icon when making a post). The formula is very hard to read as is.

  • iKettle Profile Picture
    115 on at

    Sorry

    If(IsBlank(cbERYear_2.Selected.Result),If(IsBlank(cbERQtr_2.Selected.Result),If(IsBlank(cbERProcess_2.Selected.Result),If(IsBlank(cbERStatus_2.Selected.Result),colERAll,Filter(colERAll,ReviewStatus.Value=cbERStatus_2.Selected.Result)),Filter(If(IsBlank(cbERStatus_2.Selected.Result),colERAll,Filter(colERAll,ReviewStatus.Value=cbERStatus_2.Selected.Result)),cbERProcess_2.Selected.Result=Process.Value)),Filter(If(IsBlank(cbERStatus_2.Selected.Result),colERAll,Filter(colERAll,ReviewStatus.Value=cbERStatus_2.Selected.Result)),cbERQtr_2.Selected.Result='Planned Quarter'.Value)),Filter(If(IsBlank(cbERStatus_2.Selected.Result),colERAll,Filter(colERAll,ReviewStatus.Value=cbERStatus_2.Selected.Result)),Year.Value=cbERYear_2.Selected.Result))

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard