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 / Having a default color...
Power Apps
Answered

Having a default color on Fill within an If Statement

(0) ShareShare
ReportReport
Posted on by 381

Hi 

I have built a solution in powerapps / SharePoint - but i don't think its the correct approach. 

So i am looking for a) an answer to the solution i have used b) a better solution / approach

 

I have a SharePoint list with multiple content types. one of the content types is called Figures.  This content type has columns associated to it (Jan, Feb, March, April etc )

 A user manually enters a numeric value in Jan, Feb, March, April etc. 

 

Now what i need in PowerApps is to have a icon displayed next to each month, so if the value in Jan is > 10, then the icon colour should be Red, or if it <10, then green or if the value is blank, then show Black. 

 

What i did was, i created calculated columns in that content types called 'Jan_status', Feb_Status, Mar_Status etc. and the formula i have used for each column is =IF(January>=10,"Red","Green")

 

This part all works fine. 

 

I have managed to get a icon on my power apps with circle on my edit form with the following formulae, 

 

If(DataCardValue114.Text = "Red", Red, Green)

 

Where DataCardValue114 is the value of Jan_Status calculated column. 

 

How can i write this formulae to have a default value, so if Red, then Red, else Green. Or if the DataCardValue114 is blank, then show as Black.?

 

Is there a better way to achieve what I am trying to achieve? 

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi  @Vstar19 ,

     

    Please try:

    If(
     IsEmpty(DataCardValue114.Text),
     Black,
     DataCardValue114.Text= "Red", 
     Red,
     Green
    )

     

    Best Regards,

    Bof

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard